From 61feb90d74b9373a9089a09bbbb8c04629672d4f Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Mon, 26 Nov 2012 17:59:30 +0000 Subject: Request body: fixed discard of chunked request body. Even if there is no preread data, make sure to always call ngx_http_discard_request_body_filter() in case of chunked request body to initialize r->headers_in.content_length_n for later use. --- src/http/ngx_http_request_body.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c index 931694ebe..90da11005 100644 --- a/src/http/ngx_http_request_body.c +++ b/src/http/ngx_http_request_body.c @@ -459,7 +459,7 @@ ngx_http_discard_request_body(ngx_http_request_t *r) size = r->header_in->last - r->header_in->pos; - if (size) { + if (size || r->headers_in.chunked) { rc = ngx_http_discard_request_body_filter(r, r->header_in); if (rc != NGX_OK) { -- cgit