summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2013-04-16 10:14:59 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2013-04-16 10:14:59 +0000
commit0dee57d86561d86388d28f9ad0e470bebba48c0d (patch)
treee9082738f14552593d6c9230a02714dc077be249
parent7ea00fb58cd22dc58ac7491b38f0aa6c0df50879 (diff)
downloadnginx-0dee57d86561d86388d28f9ad0e470bebba48c0d.tar.gz
nginx-0dee57d86561d86388d28f9ad0e470bebba48c0d.tar.bz2
Request body: only read body in main request (ticket #330).
Before 1.3.9 an attempt to read body in a subrequest only caused problems if body wasn't already read or discarded in a main request. Starting with 1.3.9 it might also cause problems if body was discarded by a main request before subrequest start. Fix is to just ignore attempts to read request body in a subrequest, which looks like right thing to do anyway.
-rw-r--r--src/http/ngx_http_request_body.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c
index 4e7b30257..2c612311d 100644
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -49,7 +49,7 @@ ngx_http_read_client_request_body(ngx_http_request_t *r,
}
#endif
- if (r->request_body || r->discard_body) {
+ if (r != r->main || r->request_body || r->discard_body) {
post_handler(r);
return NGX_OK;
}