Mercurial > hg > nginx
comparison src/http/ngx_http_core_module.c @ 4148:18f1cb12c6d7
Fix for "return 202" not discarding body.
Big POST (not fully preread) to a
location / {
return 202;
}
resulted in incorrect behaviour due to "return" code path not calling
ngx_http_discard_request_body(). The same applies to all "return" used
with 2xx/3xx codes except 201 and 204, and to all "return ... text" uses.
Fix is to add ngx_http_discard_request_body() call to ngx_http_send_response()
function where it looks appropriate. Discard body call from emtpy gif module
removed as it's now redundant.
Reported by Pyry Hakulinen, see
http://mailman.nginx.org/pipermail/nginx/2011-August/028503.html
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 27 Sep 2011 11:13:00 +0000 |
parents | 59b99f217c6d |
children | 28b77af3a238 |
comparison
equal
deleted
inserted
replaced
4147:7f64de1cc2c0 | 4148:18f1cb12c6d7 |
---|---|
1781 { | 1781 { |
1782 ngx_int_t rc; | 1782 ngx_int_t rc; |
1783 ngx_str_t val; | 1783 ngx_str_t val; |
1784 ngx_buf_t *b; | 1784 ngx_buf_t *b; |
1785 ngx_chain_t out; | 1785 ngx_chain_t out; |
1786 | |
1787 if (ngx_http_discard_request_body(r) != NGX_OK) { | |
1788 return NGX_HTTP_INTERNAL_SERVER_ERROR; | |
1789 } | |
1786 | 1790 |
1787 r->headers_out.status = status; | 1791 r->headers_out.status = status; |
1788 | 1792 |
1789 if (status == NGX_HTTP_NO_CONTENT) { | 1793 if (status == NGX_HTTP_NO_CONTENT) { |
1790 r->header_only = 1; | 1794 r->header_only = 1; |