Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 4168:795761886688 stable-1.0
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.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 30 Sep 2011 14:36:19 +0000 |
parents | d9b486dbf7e5 |
children | 8d39230df833 |
comparison
equal
deleted
inserted
replaced
4167:e917fc5eceb7 | 4168:795761886688 |
---|---|
2121 | 2121 |
2122 if (r->main->count != 1) { | 2122 if (r->main->count != 1) { |
2123 | 2123 |
2124 if (r->discard_body) { | 2124 if (r->discard_body) { |
2125 r->read_event_handler = ngx_http_discarded_request_body_handler; | 2125 r->read_event_handler = ngx_http_discarded_request_body_handler; |
2126 ngx_add_timer(r->connection->read, clcf->lingering_timeout); | |
2126 | 2127 |
2127 if (r->lingering_time == 0) { | 2128 if (r->lingering_time == 0) { |
2128 r->lingering_time = ngx_time() | 2129 r->lingering_time = ngx_time() |
2129 + (time_t) (clcf->lingering_time / 1000); | 2130 + (time_t) (clcf->lingering_time / 1000); |
2130 ngx_add_timer(r->connection->read, clcf->lingering_timeout); | |
2131 } | 2131 } |
2132 } | 2132 } |
2133 | 2133 |
2134 ngx_http_close_request(r, 0); | 2134 ngx_http_close_request(r, 0); |
2135 return; | 2135 return; |