diff options
author | Igor Sysoev <igor@sysoev.ru> | 2011-09-30 14:36:19 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2011-09-30 14:36:19 +0000 |
commit | f358278a69d049dc7b5d034005837d08435627ea (patch) | |
tree | 6991d9dc3ab5ad96e6462cb97e685f86515c8bb3 /src/http/ngx_http_request.c | |
parent | 0b0360a582b95a15821656663ee00f606d6d5611 (diff) | |
download | nginx-f358278a69d049dc7b5d034005837d08435627ea.tar.gz nginx-f358278a69d049dc7b5d034005837d08435627ea.zip |
Merging r3986, r4006, r4007, r4073:
Request body related fixes:
*) Always set timer in discard body handler, this fixes the cases
when request for static file is redirected by error_page to an SSI page.
*) Correctly set body if it's preread and there are extra data.
Previously all available data was used as body, resulting in garbage after
real body e.g. in case of pipelined requests. Make sure to use only as many
bytes as request's Content-Length specifies.
*) Fix body with request_body_in_single_buf.
If there were preread data and request body was big enough first part
of the request body was duplicated.
See report here:
http://mailman.nginx.org/pipermail/nginx/2011-July/027756.html
*) Bugfix: read event was not blocked after reading body.
Read event should be blocked after reading body, else undefined behaviour
might occur on additional client activity. This fixes segmentation faults
observed with proxy_ignore_client_abort set.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index d11b13e4a..5e0b8e891 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -2123,11 +2123,11 @@ ngx_http_finalize_connection(ngx_http_request_t *r) if (r->discard_body) { r->read_event_handler = ngx_http_discarded_request_body_handler; + ngx_add_timer(r->connection->read, clcf->lingering_timeout); if (r->lingering_time == 0) { r->lingering_time = ngx_time() + (time_t) (clcf->lingering_time / 1000); - ngx_add_timer(r->connection->read, clcf->lingering_timeout); } } |