2003-04-14 13:04:58 -04:00
|
|
|
|
2004-09-28 04:34:51 -04:00
|
|
|
/*
|
2004-09-29 12:00:49 -04:00
|
|
|
* Copyright (C) Igor Sysoev
|
2012-01-18 12:07:43 -03:00
|
|
|
* Copyright (C) Nginx, Inc.
|
2004-09-28 04:34:51 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2003-10-07 11:30:05 -04:00
|
|
|
#include <ngx_config.h>
|
|
|
|
#include <ngx_core.h>
|
|
|
|
#include <ngx_event.h>
|
2003-10-21 13:49:56 -03:00
|
|
|
#include <ngx_event_pipe.h>
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2003-10-21 13:49:56 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
static ngx_int_t ngx_event_pipe_read_upstream(ngx_event_pipe_t *p);
|
|
|
|
static ngx_int_t ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p);
|
2003-10-21 13:49:56 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
static ngx_int_t ngx_event_pipe_write_chain_to_temp_file(ngx_event_pipe_t *p);
|
2004-11-20 16:52:20 -03:00
|
|
|
static ngx_inline void ngx_event_pipe_remove_shadow_links(ngx_buf_t *buf);
|
2004-05-28 11:49:23 -04:00
|
|
|
static ngx_int_t ngx_event_pipe_drain_chains(ngx_event_pipe_t *p);
|
2003-10-16 17:19:16 -03:00
|
|
|
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2005-11-15 10:30:52 -03:00
|
|
|
ngx_int_t
|
2007-10-23 11:09:12 -03:00
|
|
|
ngx_event_pipe(ngx_event_pipe_t *p, ngx_int_t do_write)
|
2003-10-19 16:57:23 -03:00
|
|
|
{
|
2009-08-28 04:12:35 -04:00
|
|
|
ngx_int_t rc;
|
2015-06-03 13:12:26 -03:00
|
|
|
ngx_uint_t flags;
|
2003-10-29 05:30:44 -03:00
|
|
|
ngx_event_t *rev, *wev;
|
|
|
|
|
2003-10-19 16:57:23 -03:00
|
|
|
for ( ;; ) {
|
|
|
|
if (do_write) {
|
2005-01-25 09:27:35 -03:00
|
|
|
p->log->action = "sending to client";
|
|
|
|
|
2009-08-28 04:12:35 -04:00
|
|
|
rc = ngx_event_pipe_write_to_downstream(p);
|
|
|
|
|
|
|
|
if (rc == NGX_ABORT) {
|
2003-10-19 16:57:23 -03:00
|
|
|
return NGX_ABORT;
|
|
|
|
}
|
2009-08-28 04:12:35 -04:00
|
|
|
|
|
|
|
if (rc == NGX_BUSY) {
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
2003-10-19 16:57:23 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
p->read = 0;
|
2003-10-22 04:05:29 -03:00
|
|
|
p->upstream_blocked = 0;
|
2003-10-19 16:57:23 -03:00
|
|
|
|
2005-01-25 09:27:35 -03:00
|
|
|
p->log->action = "reading upstream";
|
|
|
|
|
2003-10-21 13:49:56 -03:00
|
|
|
if (ngx_event_pipe_read_upstream(p) == NGX_ABORT) {
|
2003-10-19 16:57:23 -03:00
|
|
|
return NGX_ABORT;
|
|
|
|
}
|
|
|
|
|
2003-10-22 04:05:29 -03:00
|
|
|
if (!p->read && !p->upstream_blocked) {
|
2003-10-19 16:57:23 -03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
do_write = 1;
|
|
|
|
}
|
|
|
|
|
2013-09-04 12:48:28 -04:00
|
|
|
if (p->upstream->fd != (ngx_socket_t) -1) {
|
2003-11-02 19:56:18 -03:00
|
|
|
rev = p->upstream->read;
|
2003-10-29 05:30:44 -03:00
|
|
|
|
2003-11-18 13:49:00 -03:00
|
|
|
flags = (rev->eof || rev->error) ? NGX_CLOSE_EVENT : 0;
|
|
|
|
|
2008-12-09 14:27:48 -03:00
|
|
|
if (ngx_handle_read_event(rev, flags) != NGX_OK) {
|
2003-11-02 19:56:18 -03:00
|
|
|
return NGX_ABORT;
|
|
|
|
}
|
2003-10-19 16:57:23 -03:00
|
|
|
|
2014-10-28 06:29:59 -03:00
|
|
|
if (!rev->delayed) {
|
|
|
|
if (rev->active && !rev->ready) {
|
|
|
|
ngx_add_timer(rev, p->read_timeout);
|
2006-02-16 12:26:46 -03:00
|
|
|
|
2014-10-28 06:29:59 -03:00
|
|
|
} else if (rev->timer_set) {
|
|
|
|
ngx_del_timer(rev);
|
|
|
|
}
|
2003-11-02 19:56:18 -03:00
|
|
|
}
|
2003-10-29 05:30:44 -03:00
|
|
|
}
|
|
|
|
|
2013-09-04 12:48:28 -04:00
|
|
|
if (p->downstream->fd != (ngx_socket_t) -1
|
|
|
|
&& p->downstream->data == p->output_ctx)
|
|
|
|
{
|
2003-11-02 19:56:18 -03:00
|
|
|
wev = p->downstream->write;
|
2008-12-09 14:27:48 -03:00
|
|
|
if (ngx_handle_write_event(wev, p->send_lowat) != NGX_OK) {
|
2003-11-02 19:56:18 -03:00
|
|
|
return NGX_ABORT;
|
|
|
|
}
|
2003-10-19 16:57:23 -03:00
|
|
|
|
2006-02-16 12:26:46 -03:00
|
|
|
if (!wev->delayed) {
|
|
|
|
if (wev->active && !wev->ready) {
|
|
|
|
ngx_add_timer(wev, p->send_timeout);
|
|
|
|
|
|
|
|
} else if (wev->timer_set) {
|
|
|
|
ngx_del_timer(wev);
|
|
|
|
}
|
2003-11-02 19:56:18 -03:00
|
|
|
}
|
2003-10-29 05:30:44 -03:00
|
|
|
}
|
|
|
|
|
2003-10-19 16:57:23 -03:00
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-11-15 10:30:52 -03:00
|
|
|
static ngx_int_t
|
|
|
|
ngx_event_pipe_read_upstream(ngx_event_pipe_t *p)
|
2003-04-14 13:04:58 -04:00
|
|
|
{
|
2014-10-28 06:29:59 -03:00
|
|
|
off_t limit;
|
2004-11-11 11:07:14 -03:00
|
|
|
ssize_t n, size;
|
|
|
|
ngx_int_t rc;
|
2004-05-28 11:49:23 -04:00
|
|
|
ngx_buf_t *b;
|
2014-10-28 06:29:59 -03:00
|
|
|
ngx_msec_t delay;
|
2005-04-08 11:18:55 -04:00
|
|
|
ngx_chain_t *chain, *cl, *ln;
|
2003-04-15 11:06:52 -04:00
|
|
|
|
2003-10-21 04:47:21 -03:00
|
|
|
if (p->upstream_eof || p->upstream_error || p->upstream_done) {
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
2016-03-18 00:44:49 -03:00
|
|
|
#if (NGX_THREADS)
|
2017-01-20 15:14:19 -03:00
|
|
|
|
2016-03-18 00:44:49 -03:00
|
|
|
if (p->aio) {
|
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe read upstream: aio");
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
2017-01-20 15:14:19 -03:00
|
|
|
|
|
|
|
if (p->writing) {
|
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe read upstream: writing");
|
|
|
|
|
|
|
|
rc = ngx_event_pipe_write_chain_to_temp_file(p);
|
|
|
|
|
|
|
|
if (rc != NGX_OK) {
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-18 00:44:49 -03:00
|
|
|
#endif
|
|
|
|
|
2004-02-11 14:08:49 -03:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe read upstream: %d", p->upstream->read->ready);
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2003-10-21 04:47:21 -03:00
|
|
|
for ( ;; ) {
|
|
|
|
|
|
|
|
if (p->upstream_eof || p->upstream_error || p->upstream_done) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
if (p->preread_bufs == NULL && !p->upstream->read->ready) {
|
2003-10-21 04:47:21 -03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
if (p->preread_bufs) {
|
2003-10-13 13:32:29 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
/* use the pre-read bufs if they exist */
|
2003-10-13 13:32:29 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
chain = p->preread_bufs;
|
|
|
|
p->preread_bufs = NULL;
|
2003-04-17 13:59:35 -04:00
|
|
|
n = p->preread_size;
|
|
|
|
|
2004-02-11 14:08:49 -03:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"pipe preread: %z", n);
|
2003-10-13 13:32:29 -03:00
|
|
|
|
2004-04-02 01:14:40 -04:00
|
|
|
if (n) {
|
|
|
|
p->read = 1;
|
|
|
|
}
|
|
|
|
|
2003-04-17 13:59:35 -04:00
|
|
|
} else {
|
|
|
|
|
2005-11-26 07:11:11 -03:00
|
|
|
#if (NGX_HAVE_KQUEUE)
|
|
|
|
|
2003-10-13 13:32:29 -03:00
|
|
|
/*
|
|
|
|
* kqueue notifies about the end of file or a pending error.
|
2004-05-28 11:49:23 -04:00
|
|
|
* This test allows not to allocate a buf on these conditions
|
2005-11-15 10:30:52 -03:00
|
|
|
* and not to call c->recv_chain().
|
2003-10-13 13:32:29 -03:00
|
|
|
*/
|
2003-04-22 11:02:58 -04:00
|
|
|
|
2003-10-30 05:51:06 -03:00
|
|
|
if (p->upstream->read->available == 0
|
2005-12-07 11:51:31 -03:00
|
|
|
&& p->upstream->read->pending_eof)
|
2003-10-30 05:51:06 -03:00
|
|
|
{
|
|
|
|
p->upstream->read->ready = 0;
|
2011-09-01 12:10:41 -03:00
|
|
|
p->upstream->read->eof = 1;
|
2003-10-30 05:51:06 -03:00
|
|
|
p->upstream_eof = 1;
|
|
|
|
p->read = 1;
|
2003-10-28 12:45:41 -03:00
|
|
|
|
|
|
|
if (p->upstream->read->kq_errno) {
|
2003-10-30 05:51:06 -03:00
|
|
|
p->upstream->read->error = 1;
|
|
|
|
p->upstream_error = 1;
|
|
|
|
p->upstream_eof = 0;
|
|
|
|
|
2003-10-28 12:45:41 -03:00
|
|
|
ngx_log_error(NGX_LOG_ERR, p->log,
|
|
|
|
p->upstream->read->kq_errno,
|
2005-11-26 07:11:11 -03:00
|
|
|
"kevent() reported that upstream "
|
|
|
|
"closed connection");
|
2003-04-22 11:02:58 -04:00
|
|
|
}
|
2003-10-28 12:45:41 -03:00
|
|
|
|
2003-10-30 05:51:06 -03:00
|
|
|
break;
|
2003-04-22 11:02:58 -04:00
|
|
|
}
|
2005-11-26 07:11:11 -03:00
|
|
|
#endif
|
2003-04-17 13:59:35 -04:00
|
|
|
|
2014-10-28 06:29:59 -03:00
|
|
|
if (p->limit_rate) {
|
|
|
|
if (p->upstream->read->delayed) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
limit = (off_t) p->limit_rate * (ngx_time() - p->start_sec + 1)
|
|
|
|
- p->read_length;
|
|
|
|
|
|
|
|
if (limit <= 0) {
|
|
|
|
p->upstream->read->delayed = 1;
|
|
|
|
delay = (ngx_msec_t) (- limit * 1000 / p->limit_rate + 1);
|
|
|
|
ngx_add_timer(p->upstream->read, delay);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
limit = 0;
|
|
|
|
}
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
if (p->free_raw_bufs) {
|
2003-10-13 13:32:29 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
/* use the free bufs if they exist */
|
2003-10-13 13:32:29 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
chain = p->free_raw_bufs;
|
2003-10-30 05:51:06 -03:00
|
|
|
if (p->single_buf) {
|
2004-05-28 11:49:23 -04:00
|
|
|
p->free_raw_bufs = p->free_raw_bufs->next;
|
2003-10-30 05:51:06 -03:00
|
|
|
chain->next = NULL;
|
|
|
|
} else {
|
2004-05-28 11:49:23 -04:00
|
|
|
p->free_raw_bufs = NULL;
|
2003-10-30 05:51:06 -03:00
|
|
|
}
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
} else if (p->allocated < p->bufs.num) {
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
/* allocate a new buf if it's still allowed */
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
b = ngx_create_temp_buf(p->pool, p->bufs.size);
|
|
|
|
if (b == NULL) {
|
2004-05-28 11:49:23 -04:00
|
|
|
return NGX_ABORT;
|
|
|
|
}
|
|
|
|
|
|
|
|
p->allocated++;
|
2003-04-21 10:55:47 -04:00
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
chain = ngx_alloc_chain_link(p->pool);
|
|
|
|
if (chain == NULL) {
|
2005-01-25 09:27:35 -03:00
|
|
|
return NGX_ABORT;
|
|
|
|
}
|
|
|
|
|
|
|
|
chain->buf = b;
|
|
|
|
chain->next = NULL;
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2007-10-14 15:56:15 -03:00
|
|
|
} else if (!p->cacheable
|
nginx-0.1.29-RELEASE import
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; the bug had appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
2005-05-12 10:58:06 -04:00
|
|
|
&& p->downstream->data == p->output_ctx
|
2005-07-08 10:34:20 -04:00
|
|
|
&& p->downstream->write->ready
|
|
|
|
&& !p->downstream->write->delayed)
|
nginx-0.1.29-RELEASE import
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; the bug had appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
2005-05-12 10:58:06 -04:00
|
|
|
{
|
2003-10-13 13:32:29 -03:00
|
|
|
/*
|
2004-05-28 11:49:23 -04:00
|
|
|
* if the bufs are not needed to be saved in a cache and
|
|
|
|
* a downstream is ready then write the bufs to a downstream
|
2003-10-13 13:32:29 -03:00
|
|
|
*/
|
|
|
|
|
2003-10-22 04:05:29 -03:00
|
|
|
p->upstream_blocked = 1;
|
|
|
|
|
2004-02-11 14:08:49 -03:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe downstream ready");
|
2003-04-17 13:59:35 -04:00
|
|
|
|
2003-04-21 10:55:47 -04:00
|
|
|
break;
|
2003-04-17 13:59:35 -04:00
|
|
|
|
2007-10-14 15:56:15 -03:00
|
|
|
} else if (p->cacheable
|
2003-11-02 19:56:18 -03:00
|
|
|
|| p->temp_file->offset < p->max_temp_file_size)
|
|
|
|
{
|
2003-10-13 13:32:29 -03:00
|
|
|
|
|
|
|
/*
|
2013-08-27 18:34:30 -04:00
|
|
|
* if it is allowed, then save some bufs from p->in
|
|
|
|
* to a temporary file, and add them to a p->out chain
|
2003-10-13 13:32:29 -03:00
|
|
|
*/
|
|
|
|
|
2003-10-21 13:49:56 -03:00
|
|
|
rc = ngx_event_pipe_write_chain_to_temp_file(p);
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2004-02-11 14:08:49 -03:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"pipe temp offset: %O", p->temp_file->offset);
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2005-06-07 11:56:31 -04:00
|
|
|
if (rc == NGX_BUSY) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2003-04-17 13:59:35 -04:00
|
|
|
if (rc != NGX_OK) {
|
|
|
|
return rc;
|
|
|
|
}
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
chain = p->free_raw_bufs;
|
2003-10-30 05:51:06 -03:00
|
|
|
if (p->single_buf) {
|
2004-05-28 11:49:23 -04:00
|
|
|
p->free_raw_bufs = p->free_raw_bufs->next;
|
2003-10-30 05:51:06 -03:00
|
|
|
chain->next = NULL;
|
|
|
|
} else {
|
2004-05-28 11:49:23 -04:00
|
|
|
p->free_raw_bufs = NULL;
|
2003-10-30 05:51:06 -03:00
|
|
|
}
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2003-04-17 13:59:35 -04:00
|
|
|
} else {
|
2003-10-13 13:32:29 -03:00
|
|
|
|
2005-01-25 09:27:35 -03:00
|
|
|
/* there are no bufs to read in */
|
2003-04-21 10:55:47 -04:00
|
|
|
|
2004-02-11 14:08:49 -03:00
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
2004-06-01 02:04:46 -04:00
|
|
|
"no pipe bufs to read in");
|
2005-11-15 10:30:52 -03:00
|
|
|
|
2003-04-17 13:59:35 -04:00
|
|
|
break;
|
2003-04-14 13:04:58 -04:00
|
|
|
}
|
|
|
|
|
2014-10-28 06:29:59 -03:00
|
|
|
n = p->upstream->recv_chain(p->upstream, chain, limit);
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2004-02-11 14:08:49 -03:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"pipe recv chain: %z", n);
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
if (p->free_raw_bufs) {
|
|
|
|
chain->next = p->free_raw_bufs;
|
2003-10-30 05:51:06 -03:00
|
|
|
}
|
2004-05-28 11:49:23 -04:00
|
|
|
p->free_raw_bufs = chain;
|
2003-10-20 14:14:07 -03:00
|
|
|
|
2003-10-13 13:32:29 -03:00
|
|
|
if (n == NGX_ERROR) {
|
|
|
|
p->upstream_error = 1;
|
|
|
|
return NGX_ERROR;
|
|
|
|
}
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2003-10-13 13:32:29 -03:00
|
|
|
if (n == NGX_AGAIN) {
|
2003-10-30 05:51:06 -03:00
|
|
|
if (p->single_buf) {
|
2004-05-28 11:49:23 -04:00
|
|
|
ngx_event_pipe_remove_shadow_links(chain->buf);
|
2003-10-30 05:51:06 -03:00
|
|
|
}
|
|
|
|
|
2003-10-13 13:32:29 -03:00
|
|
|
break;
|
2003-04-14 13:04:58 -04:00
|
|
|
}
|
|
|
|
|
2003-10-19 16:57:23 -03:00
|
|
|
p->read = 1;
|
|
|
|
|
2003-10-13 13:32:29 -03:00
|
|
|
if (n == 0) {
|
|
|
|
p->upstream_eof = 1;
|
|
|
|
break;
|
2003-04-15 11:06:52 -04:00
|
|
|
}
|
2003-04-14 13:04:58 -04:00
|
|
|
}
|
|
|
|
|
2014-10-28 06:29:59 -03:00
|
|
|
delay = p->limit_rate ? (ngx_msec_t) n * 1000 / p->limit_rate : 0;
|
|
|
|
|
2003-11-05 14:03:41 -03:00
|
|
|
p->read_length += n;
|
2003-10-22 13:38:26 -03:00
|
|
|
cl = chain;
|
2006-11-18 18:46:16 -03:00
|
|
|
p->free_raw_bufs = NULL;
|
2003-10-20 14:14:07 -03:00
|
|
|
|
2003-10-22 13:38:26 -03:00
|
|
|
while (cl && n > 0) {
|
2003-10-14 12:06:38 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
ngx_event_pipe_remove_shadow_links(cl->buf);
|
2003-10-16 17:19:16 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
size = cl->buf->end - cl->buf->last;
|
2003-10-14 12:06:38 -03:00
|
|
|
|
|
|
|
if (n >= size) {
|
2004-05-28 11:49:23 -04:00
|
|
|
cl->buf->last = cl->buf->end;
|
2003-10-14 12:06:38 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
/* STUB */ cl->buf->num = p->num++;
|
2003-10-22 04:05:29 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
if (p->input_filter(p, cl->buf) == NGX_ERROR) {
|
2003-10-14 12:06:38 -03:00
|
|
|
return NGX_ABORT;
|
|
|
|
}
|
|
|
|
|
|
|
|
n -= size;
|
2005-04-08 11:18:55 -04:00
|
|
|
ln = cl;
|
2003-10-22 13:38:26 -03:00
|
|
|
cl = cl->next;
|
2005-04-08 11:18:55 -04:00
|
|
|
ngx_free_chain(p->pool, ln);
|
2003-04-14 13:04:58 -04:00
|
|
|
|
|
|
|
} else {
|
2004-05-28 11:49:23 -04:00
|
|
|
cl->buf->last += n;
|
2003-04-14 13:04:58 -04:00
|
|
|
n = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-11-18 18:46:16 -03:00
|
|
|
if (cl) {
|
2006-11-19 04:27:10 -03:00
|
|
|
for (ln = cl; ln->next; ln = ln->next) { /* void */ }
|
2006-11-18 18:46:16 -03:00
|
|
|
|
2006-11-19 04:27:10 -03:00
|
|
|
ln->next = p->free_raw_bufs;
|
2006-11-18 18:46:16 -03:00
|
|
|
p->free_raw_bufs = cl;
|
|
|
|
}
|
2014-10-28 06:29:59 -03:00
|
|
|
|
|
|
|
if (delay > 0) {
|
|
|
|
p->upstream->read->delayed = 1;
|
|
|
|
ngx_add_timer(p->upstream->read, delay);
|
|
|
|
break;
|
|
|
|
}
|
2003-04-14 13:04:58 -04:00
|
|
|
}
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
#if (NGX_DEBUG)
|
2004-04-02 01:14:40 -04:00
|
|
|
|
2004-10-11 12:07:03 -03:00
|
|
|
for (cl = p->busy; cl; cl = cl->next) {
|
2005-01-25 09:27:35 -03:00
|
|
|
ngx_log_debug8(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe buf busy s:%d t:%d f:%d "
|
|
|
|
"%p, pos %p, size: %z "
|
2015-03-23 13:28:54 -03:00
|
|
|
"file: %O, size: %O",
|
2005-01-25 09:27:35 -03:00
|
|
|
(cl->buf->shadow ? 1 : 0),
|
|
|
|
cl->buf->temporary, cl->buf->in_file,
|
2004-05-28 11:49:23 -04:00
|
|
|
cl->buf->start, cl->buf->pos,
|
2005-01-25 09:27:35 -03:00
|
|
|
cl->buf->last - cl->buf->pos,
|
|
|
|
cl->buf->file_pos,
|
|
|
|
cl->buf->file_last - cl->buf->file_pos);
|
2004-04-02 01:14:40 -04:00
|
|
|
}
|
|
|
|
|
2004-10-11 12:07:03 -03:00
|
|
|
for (cl = p->out; cl; cl = cl->next) {
|
2005-01-25 09:27:35 -03:00
|
|
|
ngx_log_debug8(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe buf out s:%d t:%d f:%d "
|
|
|
|
"%p, pos %p, size: %z "
|
2015-03-23 13:28:54 -03:00
|
|
|
"file: %O, size: %O",
|
2005-01-25 09:27:35 -03:00
|
|
|
(cl->buf->shadow ? 1 : 0),
|
|
|
|
cl->buf->temporary, cl->buf->in_file,
|
|
|
|
cl->buf->start, cl->buf->pos,
|
|
|
|
cl->buf->last - cl->buf->pos,
|
|
|
|
cl->buf->file_pos,
|
|
|
|
cl->buf->file_last - cl->buf->file_pos);
|
2004-10-11 12:07:03 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
for (cl = p->in; cl; cl = cl->next) {
|
2005-01-25 09:27:35 -03:00
|
|
|
ngx_log_debug8(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe buf in s:%d t:%d f:%d "
|
|
|
|
"%p, pos %p, size: %z "
|
2015-03-23 13:28:54 -03:00
|
|
|
"file: %O, size: %O",
|
2005-01-25 09:27:35 -03:00
|
|
|
(cl->buf->shadow ? 1 : 0),
|
|
|
|
cl->buf->temporary, cl->buf->in_file,
|
2004-05-28 11:49:23 -04:00
|
|
|
cl->buf->start, cl->buf->pos,
|
2005-01-25 09:27:35 -03:00
|
|
|
cl->buf->last - cl->buf->pos,
|
|
|
|
cl->buf->file_pos,
|
|
|
|
cl->buf->file_last - cl->buf->file_pos);
|
2004-04-02 01:14:40 -04:00
|
|
|
}
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
for (cl = p->free_raw_bufs; cl; cl = cl->next) {
|
2005-01-25 09:27:35 -03:00
|
|
|
ngx_log_debug8(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe buf free s:%d t:%d f:%d "
|
|
|
|
"%p, pos %p, size: %z "
|
2015-03-23 13:28:54 -03:00
|
|
|
"file: %O, size: %O",
|
2005-01-25 09:27:35 -03:00
|
|
|
(cl->buf->shadow ? 1 : 0),
|
|
|
|
cl->buf->temporary, cl->buf->in_file,
|
|
|
|
cl->buf->start, cl->buf->pos,
|
|
|
|
cl->buf->last - cl->buf->pos,
|
|
|
|
cl->buf->file_pos,
|
|
|
|
cl->buf->file_last - cl->buf->file_pos);
|
2004-04-02 01:14:40 -04:00
|
|
|
}
|
|
|
|
|
2011-09-15 16:00:47 -03:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe length: %O", p->length);
|
|
|
|
|
2004-04-02 01:14:40 -04:00
|
|
|
#endif
|
|
|
|
|
2011-09-15 16:00:47 -03:00
|
|
|
if (p->free_raw_bufs && p->length != -1) {
|
|
|
|
cl = p->free_raw_bufs;
|
|
|
|
|
|
|
|
if (cl->buf->last - cl->buf->pos >= p->length) {
|
|
|
|
|
2012-02-22 08:28:53 -03:00
|
|
|
p->free_raw_bufs = cl->next;
|
|
|
|
|
2011-09-15 16:00:47 -03:00
|
|
|
/* STUB */ cl->buf->num = p->num++;
|
|
|
|
|
|
|
|
if (p->input_filter(p, cl->buf) == NGX_ERROR) {
|
2016-03-30 05:52:16 -03:00
|
|
|
return NGX_ABORT;
|
2011-09-15 16:00:47 -03:00
|
|
|
}
|
|
|
|
|
2011-09-20 06:56:35 -03:00
|
|
|
ngx_free_chain(p->pool, cl);
|
2011-09-15 16:00:47 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (p->length == 0) {
|
|
|
|
p->upstream_done = 1;
|
|
|
|
p->read = 1;
|
|
|
|
}
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
if ((p->upstream_eof || p->upstream_error) && p->free_raw_bufs) {
|
2004-03-19 01:25:53 -04:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
/* STUB */ p->free_raw_bufs->buf->num = p->num++;
|
2004-03-19 01:25:53 -04:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
if (p->input_filter(p, p->free_raw_bufs->buf) == NGX_ERROR) {
|
2003-10-16 17:19:16 -03:00
|
|
|
return NGX_ABORT;
|
2003-04-14 13:04:58 -04:00
|
|
|
}
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
p->free_raw_bufs = p->free_raw_bufs->next;
|
2003-10-30 05:51:06 -03:00
|
|
|
|
2009-05-04 15:04:00 -04:00
|
|
|
if (p->free_bufs && p->buf_to_file == NULL) {
|
2004-05-28 11:49:23 -04:00
|
|
|
for (cl = p->free_raw_bufs; cl; cl = cl->next) {
|
2004-10-11 12:07:03 -03:00
|
|
|
if (cl->buf->shadow == NULL) {
|
2005-11-15 10:30:52 -03:00
|
|
|
ngx_pfree(p->pool, cl->buf->start);
|
2004-10-11 12:07:03 -03:00
|
|
|
}
|
2003-10-31 04:10:36 -03:00
|
|
|
}
|
2003-10-30 05:51:06 -03:00
|
|
|
}
|
2003-04-14 13:04:58 -04:00
|
|
|
}
|
|
|
|
|
2014-07-04 12:47:16 -04:00
|
|
|
if (p->cacheable && (p->in || p->buf_to_file)) {
|
|
|
|
|
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe write chain");
|
|
|
|
|
2016-03-18 00:44:49 -03:00
|
|
|
rc = ngx_event_pipe_write_chain_to_temp_file(p);
|
|
|
|
|
|
|
|
if (rc != NGX_OK) {
|
|
|
|
return rc;
|
2003-04-14 13:04:58 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-10-16 17:19:16 -03:00
|
|
|
return NGX_OK;
|
2003-04-14 13:04:58 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-11-15 10:30:52 -03:00
|
|
|
static ngx_int_t
|
|
|
|
ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
|
2003-10-14 02:26:00 -03:00
|
|
|
{
|
2007-02-09 11:02:42 -03:00
|
|
|
u_char *prev;
|
2005-12-05 10:18:09 -03:00
|
|
|
size_t bsize;
|
2007-11-08 12:20:56 -03:00
|
|
|
ngx_int_t rc;
|
2009-08-28 04:12:35 -04:00
|
|
|
ngx_uint_t flush, flushed, prev_last_shadow;
|
2013-07-25 06:55:09 -04:00
|
|
|
ngx_chain_t *out, **ll, *cl;
|
2005-12-05 10:18:09 -03:00
|
|
|
ngx_connection_t *downstream;
|
|
|
|
|
|
|
|
downstream = p->downstream;
|
2003-10-14 02:26:00 -03:00
|
|
|
|
2004-02-11 14:08:49 -03:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
2005-12-05 10:18:09 -03:00
|
|
|
"pipe write downstream: %d", downstream->write->ready);
|
2003-10-19 16:57:23 -03:00
|
|
|
|
2016-03-18 00:44:49 -03:00
|
|
|
#if (NGX_THREADS)
|
|
|
|
|
|
|
|
if (p->writing) {
|
|
|
|
rc = ngx_event_pipe_write_chain_to_temp_file(p);
|
|
|
|
|
|
|
|
if (rc == NGX_ABORT) {
|
|
|
|
return NGX_ABORT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2009-08-28 04:12:35 -04:00
|
|
|
flushed = 0;
|
|
|
|
|
2003-10-19 16:57:23 -03:00
|
|
|
for ( ;; ) {
|
2003-10-21 04:47:21 -03:00
|
|
|
if (p->downstream_error) {
|
2003-10-22 13:38:26 -03:00
|
|
|
return ngx_event_pipe_drain_chains(p);
|
2003-10-21 04:47:21 -03:00
|
|
|
}
|
2003-10-19 16:57:23 -03:00
|
|
|
|
2004-03-19 01:25:53 -04:00
|
|
|
if (p->upstream_eof || p->upstream_error || p->upstream_done) {
|
|
|
|
|
|
|
|
/* pass the p->out and p->in chains to the output filter */
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; the bug had appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
2005-05-12 10:58:06 -04:00
|
|
|
for (cl = p->busy; cl; cl = cl->next) {
|
|
|
|
cl->buf->recycled = 0;
|
|
|
|
}
|
|
|
|
|
2004-03-19 01:25:53 -04:00
|
|
|
if (p->out) {
|
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe write downstream flush out");
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; the bug had appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
2005-05-12 10:58:06 -04:00
|
|
|
for (cl = p->out; cl; cl = cl->next) {
|
|
|
|
cl->buf->recycled = 0;
|
|
|
|
}
|
|
|
|
|
2007-11-08 12:20:56 -03:00
|
|
|
rc = p->output_filter(p->output_ctx, p->out);
|
|
|
|
|
|
|
|
if (rc == NGX_ERROR) {
|
2004-03-19 01:25:53 -04:00
|
|
|
p->downstream_error = 1;
|
|
|
|
return ngx_event_pipe_drain_chains(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
p->out = NULL;
|
|
|
|
}
|
|
|
|
|
2016-03-18 00:44:49 -03:00
|
|
|
if (p->writing) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2004-03-19 01:25:53 -04:00
|
|
|
if (p->in) {
|
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe write downstream flush in");
|
|
|
|
|
nginx-0.1.29-RELEASE import
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; the bug had appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
2005-05-12 10:58:06 -04:00
|
|
|
for (cl = p->in; cl; cl = cl->next) {
|
|
|
|
cl->buf->recycled = 0;
|
|
|
|
}
|
|
|
|
|
2007-11-08 12:20:56 -03:00
|
|
|
rc = p->output_filter(p->output_ctx, p->in);
|
2005-12-05 10:18:09 -03:00
|
|
|
|
2007-11-08 12:20:56 -03:00
|
|
|
if (rc == NGX_ERROR) {
|
2004-03-19 01:25:53 -04:00
|
|
|
p->downstream_error = 1;
|
|
|
|
return ngx_event_pipe_drain_chains(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
p->in = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe write downstream done");
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
/* TODO: free unused bufs */
|
2004-03-19 01:25:53 -04:00
|
|
|
|
2003-10-19 16:57:23 -03:00
|
|
|
p->downstream_done = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-12-05 10:18:09 -03:00
|
|
|
if (downstream->data != p->output_ctx
|
|
|
|
|| !downstream->write->ready
|
|
|
|
|| downstream->write->delayed)
|
nginx-0.1.29-RELEASE import
*) Feature: the ngx_http_ssi_module supports "include virtual" command.
*) Feature: the ngx_http_ssi_module supports the condition command like
'if expr="$NAME"' and "else" and "endif" commands. Only one nested
level is supported.
*) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and
DATE_GMT variables and "config timefmt" command.
*) Feature: the "ssi_ignore_recycled_buffers" directive.
*) Bugfix: the "echo" command did not show the default value for the
empty QUERY_STRING variable.
*) Change: the ngx_http_proxy_module was rewritten.
*) Feature: the "proxy_redirect", "proxy_pass_request_headers",
"proxy_pass_request_body", and "proxy_method" directives.
*) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
canceled and must be replaced with the proxy_set_header directive.
*) Change: the "proxy_preserve_host" is canceled and must be replaced
with the "proxy_set_header Host $host" and the "proxy_redirect off"
directives, the "proxy_set_header Host $host:$proxy_port" directive
and the appropriate proxy_redirect directives.
*) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
with the "proxy_set_header X-Real-IP $remote_addr" directive.
*) Change: the "proxy_add_x_forwarded_for" is canceled and must be
replaced with
the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
directive.
*) Change: the "proxy_set_x_url" is canceled and must be replaced with
the "proxy_set_header X-URL http://$host:$server_port$request_uri"
directive.
*) Feature: the "fastcgi_param" directive.
*) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
directive are canceled and must be replaced with the fastcgi_param
directives.
*) Feature: the "index" directive can use the variables.
*) Feature: the "index" directive can be used at http and server levels.
*) Change: the last index only in the "index" directive can be absolute.
*) Feature: the "rewrite" directive can use the variables.
*) Feature: the "internal" directive.
*) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
*) Change: nginx now passes the invalid lines in a client request
headers or a backend response header.
*) Bugfix: if the backend did not transfer response for a long time and
the "send_timeout" was less than "proxy_read_timeout", then nginx
returned the 408 response.
*) Bugfix: the segmentation fault was occurred if the backend sent an
invalid line in response header; the bug had appeared in 0.1.26.
*) Bugfix: the segmentation fault may occurred in FastCGI fault
tolerance configuration.
*) Bugfix: the "expires" directive did not remove the previous
"Expires" and "Cache-Control" headers.
*) Bugfix: nginx did not take into account trailing dot in "Host"
header line.
*) Bugfix: the ngx_http_auth_module did not work under Linux.
*) Bugfix: the rewrite directive worked incorrectly, if the arguments
were in a request.
*) Bugfix: nginx could not be built on MacOS X.
2005-05-12 10:58:06 -04:00
|
|
|
{
|
2003-10-19 16:57:23 -03:00
|
|
|
break;
|
|
|
|
}
|
2003-10-14 02:26:00 -03:00
|
|
|
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 10:03:58 -03:00
|
|
|
/* bsize is the size of the busy recycled bufs */
|
2003-10-22 13:38:26 -03:00
|
|
|
|
2007-02-09 11:02:42 -03:00
|
|
|
prev = NULL;
|
2003-10-22 13:38:26 -03:00
|
|
|
bsize = 0;
|
2003-10-21 04:47:21 -03:00
|
|
|
|
2004-04-02 01:14:40 -04:00
|
|
|
for (cl = p->busy; cl; cl = cl->next) {
|
2007-02-09 11:02:42 -03:00
|
|
|
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 10:03:58 -03:00
|
|
|
if (cl->buf->recycled) {
|
2007-02-12 11:58:45 -03:00
|
|
|
if (prev == cl->buf->start) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 10:03:58 -03:00
|
|
|
bsize += cl->buf->end - cl->buf->start;
|
2007-02-09 11:02:42 -03:00
|
|
|
prev = cl->buf->start;
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 10:03:58 -03:00
|
|
|
}
|
2003-10-21 04:47:21 -03:00
|
|
|
}
|
2004-04-02 01:14:40 -04:00
|
|
|
|
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 10:03:58 -03:00
|
|
|
"pipe write busy: %uz", bsize);
|
2003-10-21 04:47:21 -03:00
|
|
|
|
2003-10-21 13:49:56 -03:00
|
|
|
out = NULL;
|
2007-02-09 11:02:42 -03:00
|
|
|
|
|
|
|
if (bsize >= (size_t) p->busy_size) {
|
|
|
|
flush = 1;
|
|
|
|
goto flush;
|
|
|
|
}
|
|
|
|
|
2004-04-02 01:14:40 -04:00
|
|
|
flush = 0;
|
2007-02-09 11:02:42 -03:00
|
|
|
ll = NULL;
|
2007-01-17 13:10:40 -03:00
|
|
|
prev_last_shadow = 1;
|
2003-10-21 04:47:21 -03:00
|
|
|
|
2003-10-21 13:49:56 -03:00
|
|
|
for ( ;; ) {
|
|
|
|
if (p->out) {
|
2003-10-22 13:38:26 -03:00
|
|
|
cl = p->out;
|
2003-10-14 12:06:38 -03:00
|
|
|
|
2011-10-31 06:53:16 -03:00
|
|
|
if (cl->buf->recycled) {
|
|
|
|
ngx_log_error(NGX_LOG_ALERT, p->log, 0,
|
|
|
|
"recycled buffer in pipe out chain");
|
2004-03-23 02:01:52 -04:00
|
|
|
}
|
2003-10-14 12:06:38 -03:00
|
|
|
|
2003-10-21 13:49:56 -03:00
|
|
|
p->out = p->out->next;
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 10:03:58 -03:00
|
|
|
|
2016-03-18 00:44:49 -03:00
|
|
|
} else if (!p->cacheable && !p->writing && p->in) {
|
2003-10-22 13:38:26 -03:00
|
|
|
cl = p->in;
|
2003-10-14 12:06:38 -03:00
|
|
|
|
2007-01-15 13:00:51 -03:00
|
|
|
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe write buf ls:%d %p %z",
|
|
|
|
cl->buf->last_shadow,
|
|
|
|
cl->buf->pos,
|
|
|
|
cl->buf->last - cl->buf->pos);
|
|
|
|
|
2011-10-31 06:53:16 -03:00
|
|
|
if (cl->buf->recycled && prev_last_shadow) {
|
|
|
|
if (bsize + cl->buf->end - cl->buf->start > p->busy_size) {
|
|
|
|
flush = 1;
|
|
|
|
break;
|
2007-01-17 13:10:40 -03:00
|
|
|
}
|
|
|
|
|
2011-10-31 06:53:16 -03:00
|
|
|
bsize += cl->buf->end - cl->buf->start;
|
2004-03-23 02:01:52 -04:00
|
|
|
}
|
2003-10-21 13:49:56 -03:00
|
|
|
|
2007-01-17 13:10:40 -03:00
|
|
|
prev_last_shadow = cl->buf->last_shadow;
|
|
|
|
|
2003-10-21 13:49:56 -03:00
|
|
|
p->in = p->in->next;
|
|
|
|
|
|
|
|
} else {
|
2003-10-14 12:06:38 -03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2003-10-22 13:38:26 -03:00
|
|
|
cl->next = NULL;
|
2005-03-19 08:38:37 -04:00
|
|
|
|
|
|
|
if (out) {
|
|
|
|
*ll = cl;
|
|
|
|
} else {
|
|
|
|
out = cl;
|
|
|
|
}
|
|
|
|
ll = &cl->next;
|
2003-10-21 13:49:56 -03:00
|
|
|
}
|
2003-10-14 02:26:00 -03:00
|
|
|
|
2007-02-09 11:02:42 -03:00
|
|
|
flush:
|
|
|
|
|
2004-04-02 01:14:40 -04:00
|
|
|
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
2016-03-30 20:33:57 -03:00
|
|
|
"pipe write: out:%p, f:%ui", out, flush);
|
2003-10-22 04:05:29 -03:00
|
|
|
|
2009-08-28 04:12:35 -04:00
|
|
|
if (out == NULL) {
|
|
|
|
|
|
|
|
if (!flush) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* a workaround for AIO */
|
|
|
|
if (flushed++ > 10) {
|
|
|
|
return NGX_BUSY;
|
|
|
|
}
|
2003-10-14 02:26:00 -03:00
|
|
|
}
|
|
|
|
|
2007-11-08 12:20:56 -03:00
|
|
|
rc = p->output_filter(p->output_ctx, out);
|
|
|
|
|
2011-09-20 06:55:27 -03:00
|
|
|
ngx_chain_update_chains(p->pool, &p->free, &p->busy, &out, p->tag);
|
|
|
|
|
2007-11-08 12:20:56 -03:00
|
|
|
if (rc == NGX_ERROR) {
|
2003-10-20 14:14:07 -03:00
|
|
|
p->downstream_error = 1;
|
2004-03-19 01:25:53 -04:00
|
|
|
return ngx_event_pipe_drain_chains(p);
|
2003-10-19 16:57:23 -03:00
|
|
|
}
|
|
|
|
|
2003-10-22 13:38:26 -03:00
|
|
|
for (cl = p->free; cl; cl = cl->next) {
|
2003-10-22 04:05:29 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
if (cl->buf->temp_file) {
|
2007-10-14 15:56:15 -03:00
|
|
|
if (p->cacheable || !p->cyclic_temp_file) {
|
2003-11-05 14:03:41 -03:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
/* reset p->temp_offset if all bufs had been sent */
|
2003-11-05 14:03:41 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
if (cl->buf->file_last == p->temp_file->offset) {
|
2003-11-05 14:03:41 -03:00
|
|
|
p->temp_file->offset = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
/* TODO: free buf if p->free_bufs && upstream done */
|
2003-11-09 17:03:38 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
/* add the free shadow raw buf to p->free_raw_bufs */
|
2003-10-22 04:05:29 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
if (cl->buf->last_shadow) {
|
2005-01-25 09:27:35 -03:00
|
|
|
if (ngx_event_pipe_add_free_buf(p, cl->buf->shadow) != NGX_OK) {
|
|
|
|
return NGX_ABORT;
|
|
|
|
}
|
2003-10-14 02:26:00 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
cl->buf->last_shadow = 0;
|
2003-10-14 02:26:00 -03:00
|
|
|
}
|
2003-10-22 04:05:29 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
cl->buf->shadow = NULL;
|
2003-10-14 02:26:00 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-11-15 10:30:52 -03:00
|
|
|
static ngx_int_t
|
|
|
|
ngx_event_pipe_write_chain_to_temp_file(ngx_event_pipe_t *p)
|
2003-04-14 13:04:58 -04:00
|
|
|
{
|
2011-10-31 06:54:55 -03:00
|
|
|
ssize_t size, bsize, n;
|
2004-05-28 11:49:23 -04:00
|
|
|
ngx_buf_t *b;
|
2011-10-31 06:53:16 -03:00
|
|
|
ngx_uint_t prev_last_shadow;
|
2016-03-18 00:44:49 -03:00
|
|
|
ngx_chain_t *cl, *tl, *next, *out, **ll, **last_out, **last_free;
|
|
|
|
|
|
|
|
#if (NGX_THREADS)
|
|
|
|
|
|
|
|
if (p->writing) {
|
|
|
|
|
|
|
|
if (p->aio) {
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
out = p->writing;
|
|
|
|
p->writing = NULL;
|
|
|
|
|
|
|
|
n = ngx_write_chain_to_temp_file(p->temp_file, NULL);
|
|
|
|
|
|
|
|
if (n == NGX_ERROR) {
|
|
|
|
return NGX_ABORT;
|
|
|
|
}
|
|
|
|
|
|
|
|
goto done;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
if (p->buf_to_file) {
|
2016-03-18 00:44:49 -03:00
|
|
|
out = ngx_alloc_chain_link(p->pool);
|
|
|
|
if (out == NULL) {
|
|
|
|
return NGX_ABORT;
|
|
|
|
}
|
|
|
|
|
|
|
|
out->buf = p->buf_to_file;
|
|
|
|
out->next = p->in;
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2003-11-02 19:56:18 -03:00
|
|
|
} else {
|
2003-11-17 13:15:03 -03:00
|
|
|
out = p->in;
|
2003-04-14 13:04:58 -04:00
|
|
|
}
|
|
|
|
|
2007-10-14 15:56:15 -03:00
|
|
|
if (!p->cacheable) {
|
2003-04-14 13:04:58 -04:00
|
|
|
|
|
|
|
size = 0;
|
2003-11-17 13:15:03 -03:00
|
|
|
cl = out;
|
2003-10-22 13:38:26 -03:00
|
|
|
ll = NULL;
|
2011-10-31 06:53:16 -03:00
|
|
|
prev_last_shadow = 1;
|
2003-10-21 04:47:21 -03:00
|
|
|
|
2004-02-11 14:08:49 -03:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
2004-11-11 11:07:14 -03:00
|
|
|
"pipe offset: %O", p->temp_file->offset);
|
2003-04-14 13:04:58 -04:00
|
|
|
|
|
|
|
do {
|
2004-05-28 11:49:23 -04:00
|
|
|
bsize = cl->buf->last - cl->buf->pos;
|
2003-10-21 04:47:21 -03:00
|
|
|
|
2011-10-31 06:53:16 -03:00
|
|
|
ngx_log_debug4(NGX_LOG_DEBUG_EVENT, p->log, 0,
|
|
|
|
"pipe buf ls:%d %p, pos %p, size: %z",
|
|
|
|
cl->buf->last_shadow, cl->buf->start,
|
|
|
|
cl->buf->pos, bsize);
|
2003-10-21 04:47:21 -03:00
|
|
|
|
2011-10-31 06:53:16 -03:00
|
|
|
if (prev_last_shadow
|
|
|
|
&& ((size + bsize > p->temp_file_write_size)
|
|
|
|
|| (p->temp_file->offset + size + bsize
|
|
|
|
> p->max_temp_file_size)))
|
2003-10-20 14:14:07 -03:00
|
|
|
{
|
2003-04-14 13:04:58 -04:00
|
|
|
break;
|
|
|
|
}
|
2003-10-21 04:47:21 -03:00
|
|
|
|
2011-10-31 06:53:16 -03:00
|
|
|
prev_last_shadow = cl->buf->last_shadow;
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
size += bsize;
|
2003-10-22 13:38:26 -03:00
|
|
|
ll = &cl->next;
|
|
|
|
cl = cl->next;
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2003-10-22 13:38:26 -03:00
|
|
|
} while (cl);
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2004-11-11 11:07:14 -03:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0, "size: %z", size);
|
2003-10-21 04:47:21 -03:00
|
|
|
|
2005-06-07 11:56:31 -04:00
|
|
|
if (ll == NULL) {
|
|
|
|
return NGX_BUSY;
|
|
|
|
}
|
|
|
|
|
2003-10-22 13:38:26 -03:00
|
|
|
if (cl) {
|
2016-03-30 05:52:16 -03:00
|
|
|
p->in = cl;
|
|
|
|
*ll = NULL;
|
2003-10-20 14:14:07 -03:00
|
|
|
|
|
|
|
} else {
|
2016-03-30 05:52:16 -03:00
|
|
|
p->in = NULL;
|
|
|
|
p->last_in = &p->in;
|
2003-10-20 14:14:07 -03:00
|
|
|
}
|
2003-04-14 13:04:58 -04:00
|
|
|
|
|
|
|
} else {
|
2003-10-21 13:49:56 -03:00
|
|
|
p->in = NULL;
|
2003-10-21 04:47:21 -03:00
|
|
|
p->last_in = &p->in;
|
2003-04-14 13:04:58 -04:00
|
|
|
}
|
|
|
|
|
2016-03-18 00:44:49 -03:00
|
|
|
#if (NGX_THREADS)
|
2016-09-01 14:05:23 -03:00
|
|
|
if (p->thread_handler) {
|
|
|
|
p->temp_file->thread_write = 1;
|
|
|
|
p->temp_file->file.thread_task = p->thread_task;
|
|
|
|
p->temp_file->file.thread_handler = p->thread_handler;
|
|
|
|
p->temp_file->file.thread_ctx = p->thread_ctx;
|
|
|
|
}
|
2016-03-18 00:44:49 -03:00
|
|
|
#endif
|
|
|
|
|
2011-10-31 06:54:55 -03:00
|
|
|
n = ngx_write_chain_to_temp_file(p->temp_file, out);
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2011-10-31 06:54:55 -03:00
|
|
|
if (n == NGX_ERROR) {
|
|
|
|
return NGX_ABORT;
|
2003-10-19 16:57:23 -03:00
|
|
|
}
|
|
|
|
|
2016-03-18 00:44:49 -03:00
|
|
|
#if (NGX_THREADS)
|
|
|
|
|
|
|
|
if (n == NGX_AGAIN) {
|
|
|
|
p->writing = out;
|
|
|
|
p->thread_task = p->temp_file->file.thread_task;
|
|
|
|
return NGX_AGAIN;
|
|
|
|
}
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
if (p->buf_to_file) {
|
|
|
|
p->temp_file->offset = p->buf_to_file->last - p->buf_to_file->pos;
|
2011-10-31 06:54:55 -03:00
|
|
|
n -= p->buf_to_file->last - p->buf_to_file->pos;
|
2004-05-28 11:49:23 -04:00
|
|
|
p->buf_to_file = NULL;
|
2003-11-17 13:15:03 -03:00
|
|
|
out = out->next;
|
2003-11-02 19:56:18 -03:00
|
|
|
}
|
|
|
|
|
2011-10-31 06:54:55 -03:00
|
|
|
if (n > 0) {
|
|
|
|
/* update previous buffer or add new buffer */
|
|
|
|
|
|
|
|
if (p->out) {
|
|
|
|
for (cl = p->out; cl->next; cl = cl->next) { /* void */ }
|
|
|
|
|
|
|
|
b = cl->buf;
|
|
|
|
|
|
|
|
if (b->file_last == p->temp_file->offset) {
|
|
|
|
p->temp_file->offset += n;
|
|
|
|
b->file_last = p->temp_file->offset;
|
|
|
|
goto free;
|
|
|
|
}
|
|
|
|
|
|
|
|
last_out = &cl->next;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
last_out = &p->out;
|
|
|
|
}
|
|
|
|
|
|
|
|
cl = ngx_chain_get_free_buf(p->pool, &p->free);
|
|
|
|
if (cl == NULL) {
|
|
|
|
return NGX_ABORT;
|
|
|
|
}
|
2003-04-14 13:04:58 -04:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
b = cl->buf;
|
2011-10-31 06:54:55 -03:00
|
|
|
|
|
|
|
ngx_memzero(b, sizeof(ngx_buf_t));
|
|
|
|
|
|
|
|
b->tag = p->tag;
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
b->file = &p->temp_file->file;
|
|
|
|
b->file_pos = p->temp_file->offset;
|
2011-10-31 06:54:55 -03:00
|
|
|
p->temp_file->offset += n;
|
2004-05-28 11:49:23 -04:00
|
|
|
b->file_last = p->temp_file->offset;
|
2003-11-05 14:03:41 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
b->in_file = 1;
|
|
|
|
b->temp_file = 1;
|
2003-10-22 04:05:29 -03:00
|
|
|
|
2011-10-31 06:54:55 -03:00
|
|
|
*last_out = cl;
|
|
|
|
}
|
|
|
|
|
|
|
|
free:
|
|
|
|
|
|
|
|
for (last_free = &p->free_raw_bufs;
|
|
|
|
*last_free != NULL;
|
|
|
|
last_free = &(*last_free)->next)
|
|
|
|
{
|
|
|
|
/* void */
|
|
|
|
}
|
|
|
|
|
|
|
|
for (cl = out; cl; cl = next) {
|
|
|
|
next = cl->next;
|
|
|
|
|
|
|
|
cl->next = p->free;
|
|
|
|
p->free = cl;
|
|
|
|
|
|
|
|
b = cl->buf;
|
2003-10-19 16:57:23 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
if (b->last_shadow) {
|
2004-10-11 12:07:03 -03:00
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
tl = ngx_alloc_chain_link(p->pool);
|
|
|
|
if (tl == NULL) {
|
2005-01-25 09:27:35 -03:00
|
|
|
return NGX_ABORT;
|
|
|
|
}
|
|
|
|
|
|
|
|
tl->buf = b->shadow;
|
|
|
|
tl->next = NULL;
|
2004-10-11 12:07:03 -03:00
|
|
|
|
2003-10-22 13:38:26 -03:00
|
|
|
*last_free = tl;
|
|
|
|
last_free = &tl->next;
|
2005-01-25 09:27:35 -03:00
|
|
|
|
|
|
|
b->shadow->pos = b->shadow->start;
|
|
|
|
b->shadow->last = b->shadow->start;
|
|
|
|
|
|
|
|
ngx_event_pipe_remove_shadow_links(b->shadow);
|
2003-04-14 13:04:58 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
2003-04-15 11:06:52 -04:00
|
|
|
|
2003-04-21 10:55:47 -04:00
|
|
|
|
2003-04-15 11:06:52 -04:00
|
|
|
/* the copy input filter */
|
|
|
|
|
2005-11-15 10:30:52 -03:00
|
|
|
ngx_int_t
|
|
|
|
ngx_event_pipe_copy_input_filter(ngx_event_pipe_t *p, ngx_buf_t *buf)
|
2003-04-15 11:06:52 -04:00
|
|
|
{
|
2004-05-28 11:49:23 -04:00
|
|
|
ngx_buf_t *b;
|
2003-10-22 13:38:26 -03:00
|
|
|
ngx_chain_t *cl;
|
2003-04-15 11:06:52 -04:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
if (buf->pos == buf->last) {
|
2003-10-14 12:06:38 -03:00
|
|
|
return NGX_OK;
|
|
|
|
}
|
2003-04-15 11:06:52 -04:00
|
|
|
|
2013-12-11 14:30:38 -03:00
|
|
|
cl = ngx_chain_get_free_buf(p->pool, &p->free);
|
|
|
|
if (cl == NULL) {
|
|
|
|
return NGX_ERROR;
|
2003-10-14 12:06:38 -03:00
|
|
|
}
|
2003-04-15 11:06:52 -04:00
|
|
|
|
2013-12-11 14:30:38 -03:00
|
|
|
b = cl->buf;
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
ngx_memcpy(b, buf, sizeof(ngx_buf_t));
|
|
|
|
b->shadow = buf;
|
|
|
|
b->tag = p->tag;
|
|
|
|
b->last_shadow = 1;
|
|
|
|
b->recycled = 1;
|
|
|
|
buf->shadow = b;
|
2003-04-15 11:06:52 -04:00
|
|
|
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 10:03:58 -03:00
|
|
|
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0, "input buf #%d", b->num);
|
2004-02-11 14:08:49 -03:00
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
if (p->in) {
|
|
|
|
*p->last_in = cl;
|
|
|
|
} else {
|
|
|
|
p->in = cl;
|
|
|
|
}
|
|
|
|
p->last_in = &cl->next;
|
2003-04-15 11:06:52 -04:00
|
|
|
|
2011-09-15 16:00:47 -03:00
|
|
|
if (p->length == -1) {
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
p->length -= b->last - b->pos;
|
|
|
|
|
2003-10-14 12:06:38 -03:00
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-11-15 10:30:52 -03:00
|
|
|
static ngx_inline void
|
|
|
|
ngx_event_pipe_remove_shadow_links(ngx_buf_t *buf)
|
2003-10-14 12:06:38 -03:00
|
|
|
{
|
2004-05-28 11:49:23 -04:00
|
|
|
ngx_buf_t *b, *next;
|
2003-10-16 17:19:16 -03:00
|
|
|
|
2004-10-11 12:07:03 -03:00
|
|
|
b = buf->shadow;
|
|
|
|
|
|
|
|
if (b == NULL) {
|
2003-10-16 17:19:16 -03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
while (!b->last_shadow) {
|
|
|
|
next = b->shadow;
|
2004-09-28 11:44:42 -04:00
|
|
|
|
2004-10-11 12:07:03 -03:00
|
|
|
b->temporary = 0;
|
|
|
|
b->recycled = 0;
|
2004-09-28 04:34:51 -04:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
b->shadow = NULL;
|
|
|
|
b = next;
|
2003-10-16 17:19:16 -03:00
|
|
|
}
|
|
|
|
|
2004-10-11 12:07:03 -03:00
|
|
|
b->temporary = 0;
|
|
|
|
b->recycled = 0;
|
2004-09-28 11:44:42 -04:00
|
|
|
b->last_shadow = 0;
|
2003-10-16 17:19:16 -03:00
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
b->shadow = NULL;
|
|
|
|
|
|
|
|
buf->shadow = NULL;
|
2003-10-14 12:06:38 -03:00
|
|
|
}
|
2003-04-15 11:06:52 -04:00
|
|
|
|
|
|
|
|
2005-11-15 10:30:52 -03:00
|
|
|
ngx_int_t
|
|
|
|
ngx_event_pipe_add_free_buf(ngx_event_pipe_t *p, ngx_buf_t *b)
|
2003-10-14 12:06:38 -03:00
|
|
|
{
|
2005-01-25 09:27:35 -03:00
|
|
|
ngx_chain_t *cl;
|
|
|
|
|
2005-03-19 08:38:37 -04:00
|
|
|
cl = ngx_alloc_chain_link(p->pool);
|
|
|
|
if (cl == NULL) {
|
2005-01-25 09:27:35 -03:00
|
|
|
return NGX_ERROR;
|
2003-10-16 17:19:16 -03:00
|
|
|
}
|
|
|
|
|
2012-10-30 08:14:24 -03:00
|
|
|
if (p->buf_to_file && b->start == p->buf_to_file->start) {
|
|
|
|
b->pos = p->buf_to_file->last;
|
|
|
|
b->last = p->buf_to_file->last;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
b->pos = b->start;
|
|
|
|
b->last = b->start;
|
|
|
|
}
|
|
|
|
|
2005-01-25 09:27:35 -03:00
|
|
|
b->shadow = NULL;
|
2003-10-14 12:06:38 -03:00
|
|
|
|
2005-01-25 09:27:35 -03:00
|
|
|
cl->buf = b;
|
|
|
|
|
|
|
|
if (p->free_raw_bufs == NULL) {
|
|
|
|
p->free_raw_bufs = cl;
|
|
|
|
cl->next = NULL;
|
|
|
|
|
|
|
|
return NGX_OK;
|
2003-10-14 12:06:38 -03:00
|
|
|
}
|
2005-01-25 09:27:35 -03:00
|
|
|
|
|
|
|
if (p->free_raw_bufs->buf->pos == p->free_raw_bufs->buf->last) {
|
|
|
|
|
|
|
|
/* add the free buf to the list start */
|
|
|
|
|
|
|
|
cl->next = p->free_raw_bufs;
|
|
|
|
p->free_raw_bufs = cl;
|
|
|
|
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
2012-02-28 08:31:05 -03:00
|
|
|
/* the first free buf is partially filled, thus add the free buf after it */
|
2005-01-25 09:27:35 -03:00
|
|
|
|
|
|
|
cl->next = p->free_raw_bufs->next;
|
|
|
|
p->free_raw_bufs->next = cl;
|
|
|
|
|
|
|
|
return NGX_OK;
|
2003-10-14 12:06:38 -03:00
|
|
|
}
|
2003-10-21 04:47:21 -03:00
|
|
|
|
|
|
|
|
2005-11-15 10:30:52 -03:00
|
|
|
static ngx_int_t
|
|
|
|
ngx_event_pipe_drain_chains(ngx_event_pipe_t *p)
|
2003-10-21 04:47:21 -03:00
|
|
|
{
|
2003-10-22 13:38:26 -03:00
|
|
|
ngx_chain_t *cl, *tl;
|
2003-10-21 04:47:21 -03:00
|
|
|
|
|
|
|
for ( ;; ) {
|
|
|
|
if (p->busy) {
|
2003-10-22 13:38:26 -03:00
|
|
|
cl = p->busy;
|
2003-11-18 05:04:34 -03:00
|
|
|
p->busy = NULL;
|
2003-10-21 04:47:21 -03:00
|
|
|
|
|
|
|
} else if (p->out) {
|
2003-10-22 13:38:26 -03:00
|
|
|
cl = p->out;
|
2003-11-18 05:04:34 -03:00
|
|
|
p->out = NULL;
|
2003-10-21 04:47:21 -03:00
|
|
|
|
|
|
|
} else if (p->in) {
|
2003-10-22 13:38:26 -03:00
|
|
|
cl = p->in;
|
2003-11-18 05:04:34 -03:00
|
|
|
p->in = NULL;
|
2003-10-21 04:47:21 -03:00
|
|
|
|
|
|
|
} else {
|
|
|
|
return NGX_OK;
|
|
|
|
}
|
|
|
|
|
2003-10-22 13:38:26 -03:00
|
|
|
while (cl) {
|
2004-05-28 11:49:23 -04:00
|
|
|
if (cl->buf->last_shadow) {
|
2005-01-25 09:27:35 -03:00
|
|
|
if (ngx_event_pipe_add_free_buf(p, cl->buf->shadow) != NGX_OK) {
|
nginx-0.1.14-RELEASE import
*) Feature: the autoconfiguration directives:
--http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
--http-fastcgi-temp-path=PATH
*) Change: the directory name for the temporary files with the client
request body is specified by directive client_body_temp_path, by
default it is <prefix>/client_body_temp.
*) Feature: the ngx_http_fastcgi_module and the directives:
fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
fastcgi_busy_buffers_size, fastcgi_temp_path,
fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
fastcgi_next_upstream, and fastcgi_x_powered_by.
*) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
0.1.3.
*) Change: the URI must be specified after the host name in the
proxy_pass directive.
*) Change: the %3F symbol in the URI was considered as the argument
string start.
*) Feature: the unix domain sockets support in the
ngx_http_proxy_module.
*) Feature: the ssl_engine and ssl_ciphers directives.
Thanks to Sergey Skvortsov for SSL-accelerator.
2005-01-18 10:03:58 -03:00
|
|
|
return NGX_ABORT;
|
|
|
|
}
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
cl->buf->last_shadow = 0;
|
2003-10-21 04:47:21 -03:00
|
|
|
}
|
|
|
|
|
2004-05-28 11:49:23 -04:00
|
|
|
cl->buf->shadow = NULL;
|
2003-10-22 13:38:26 -03:00
|
|
|
tl = cl->next;
|
|
|
|
cl->next = p->free;
|
|
|
|
p->free = cl;
|
|
|
|
cl = tl;
|
2003-10-21 04:47:21 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|