summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2011-08-18 15:27:57 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2011-08-18 15:27:57 +0000
commitf48b45119557790fc26f7d4b3d081ea6f27c9301 (patch)
tree9c88cdabad203369f9f01fcdeff0d9d8116d7c0d
parent950b668076393b11301bf9f88d03f677ba1b8761 (diff)
downloadnginx-f48b45119557790fc26f7d4b3d081ea6f27c9301.tar.gz
nginx-f48b45119557790fc26f7d4b3d081ea6f27c9301.tar.bz2
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.
-rw-r--r--src/http/ngx_http_request_body.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c
index be311a612..57c201b9b 100644
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -143,6 +143,7 @@ ngx_http_read_client_request_body(ngx_http_request_t *r,
r->header_in->pos += (size_t) r->headers_in.content_length_n;
r->request_length += r->headers_in.content_length_n;
+ b->last = r->header_in->pos;
if (r->request_body_in_file_only) {
if (ngx_http_write_request_body(r, rb->bufs) != NGX_OK) {