diff options
author | Roman Arutyunyan <arut@nginx.com> | 2015-12-08 17:39:56 +0300 |
---|---|---|
committer | Roman Arutyunyan <arut@nginx.com> | 2015-12-08 17:39:56 +0300 |
commit | 5c1f76f0e933335784ebb4811965230ab8f20233 (patch) | |
tree | 3b119c33de69d772761140579c4c5169811927a3 | |
parent | 79fcf261d0b50c03ae2780b5588b59ed2eb7ad88 (diff) |
Slice filter: never run subrequests when main request is buffered.
With main request buffered, it's possible, that a slice subrequest will send
output before it. For example, while main request is waiting for aio read to
complete, a slice subrequest can start an aio operation as well. The order
in which aio callbacks are called is undetermined.
-rw-r--r-- | src/http/modules/ngx_http_slice_filter_module.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_slice_filter_module.c b/src/http/modules/ngx_http_slice_filter_module.c index 8cdb9bc6..aa2a0344 100644 --- a/src/http/modules/ngx_http_slice_filter_module.c +++ b/src/http/modules/ngx_http_slice_filter_module.c @@ -239,6 +239,10 @@ ngx_http_slice_body_filter(ngx_http_request_t *r, ngx_chain_t *in) return rc; } + if (r->buffered) { + return rc; + } + if (ngx_http_subrequest(r, &r->uri, &r->args, &sr, NULL, 0) != NGX_OK) { return NGX_ERROR; } |