diff options
author | Igor Sysoev <igor@sysoev.ru> | 2005-07-08 14:34:20 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2005-07-08 14:34:20 +0000 |
commit | 5192b3651f2f44fb5769828a2a4060989c7e9c5f (patch) | |
tree | d1ef9dfd855e836c6f05b496be88dc835537d03f /src/http/ngx_http_request.c | |
parent | 549c6c644976dc694765d77110ebd2504ff7ce2b (diff) | |
download | nginx-release-0.1.38.tar.gz nginx-release-0.1.38.zip |
nginx-0.1.38-RELEASE importrelease-0.1.38
*) Feature: the "limit_rate" directive is supported in in proxy and
FastCGI mode.
*) Feature: the "X-Accel-Limit-Rate" response header line is supported
in proxy and FastCGI mode.
*) Feature: the "break" directive.
*) Feature: the "log_not_found" directive.
*) Bugfix: the response status code was not changed when request was
redirected by the ""X-Accel-Redirect" header line.
*) Bugfix: the variables set by the "set" directive could not be used
in SSI.
*) Bugfix: the segmentation fault may occurred if the SSI page has more
than one remote subrequest.
*) Bugfix: nginx treated the backend response as invalid if the status
line in the header was transferred in two packets; the bug had
appeared in 0.1.29.
*) Feature: the "ssi_types" directive.
*) Feature: the "autoindex_exact_size" directive.
*) Bugfix: the ngx_http_autoindex_module did not support the long file
names in UTF-8.
*) Feature: the IMAP/POP3 proxy.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 9ced028a5..f41a891b7 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -90,11 +90,6 @@ ngx_http_header_t ngx_http_headers_in[] = { { ngx_string("Range"), offsetof(ngx_http_headers_in_t, range), ngx_http_process_header_line }, -#if 0 - { ngx_string("If-Range"), offsetof(ngx_http_headers_in_t, if_range), - ngx_http_process_header_line }, -#endif - #if (NGX_HTTP_GZIP) { ngx_string("Accept-Encoding"), offsetof(ngx_http_headers_in_t, accept_encoding), @@ -1441,6 +1436,8 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc) r->done = 1; if (r != r->connection->data) { + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "http finalize non-active request: \"%V\"", &r->uri); return; } @@ -1448,12 +1445,18 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc) pr = r->parent; + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "http parent request: \"%V\"", &pr->uri); + if (rc != NGX_AGAIN) { pr->connection->data = pr; } if (pr->postponed) { + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "http request: \"%V\" has postponed", &pr->uri); + if (rc != NGX_AGAIN && pr->postponed->request == r) { pr->postponed = pr->postponed->next; @@ -1462,9 +1465,13 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc) } } + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, + "http request: \"%V\" still has postponed", + &pr->uri); + if (pr->done) { ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http wake request: \"%V\"", &pr->uri); + "http wake parent request: \"%V\"", &pr->uri); pr->write_event_handler(pr); } @@ -1483,7 +1490,7 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc) ngx_del_timer(r->connection->write); } - if (rc == NGX_HTTP_CLIENT_CLOSED_REQUEST || r->closed) { + if (r->connection->closed) { ngx_http_close_request(r, 0); ngx_http_close_connection(r->connection); return; @@ -1492,13 +1499,15 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc) ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc)); return; + } - } else if (rc == NGX_ERROR) { + if (rc == NGX_ERROR || r->connection->closed) { ngx_http_close_request(r, 0); ngx_http_close_connection(r->connection); return; + } - } else if (rc == NGX_AGAIN || r->out) { + if (rc == NGX_AGAIN || r->out) { (void) ngx_http_set_write_handler(r); return; } @@ -1553,6 +1562,10 @@ ngx_http_set_write_handler(ngx_http_request_t *r) r->write_event_handler = ngx_http_writer; + if (r->connection->closed) { + return NGX_OK; + } + wev = r->connection->write; if (wev->ready && wev->delayed) { @@ -1673,6 +1686,9 @@ static ngx_int_t ngx_http_postponed_handler(ngx_http_request_t *r) { ngx_int_t rc; +#if 0 + ngx_http_request_t *mr; +#endif ngx_http_postponed_request_t *pr; ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, @@ -1687,20 +1703,16 @@ ngx_http_postponed_handler(ngx_http_request_t *r) rc = ngx_http_output_filter(r, NULL); ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http postponed output filter: %d", rc); + "http postponed output filter: %d", rc); if (rc == NGX_AGAIN) { return rc; } - if (rc == NGX_ERROR) { - /* NGX_ERROR may be returned by any filter */ - r->connection->write->error = 1; - - ngx_http_finalize_request(r, rc); - - return NGX_DONE; - } + /* + * we treat NGX_ERROR as NGX_OK, because we need to complete + * all postponed requests + */ pr = r->postponed; @@ -1713,7 +1725,7 @@ ngx_http_postponed_handler(ngx_http_request_t *r) r->connection->data = r; ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, - "http postponed request \"%V\"", &r->uri); + "http wake child request \"%V\"", &r->uri); r->write_event_handler(r); @@ -1833,7 +1845,7 @@ ngx_http_read_discarded_body(ngx_http_request_t *r) if (n == NGX_ERROR) { - r->closed = 1; + r->connection->closed = 1; /* * if a client request body is discarded then we already set |