# HG changeset patch # User Roman Arutyunyan # Date 1449585596 -10800 # Node ID bc9ea464e35419d2bade92b13f34cb18de7a8837 # Parent a6902a941279befbcde1796b4fad77b9bc2d0a9e 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. diff -r a6902a941279 -r bc9ea464e354 src/http/modules/ngx_http_slice_filter_module.c --- a/src/http/modules/ngx_http_slice_filter_module.c Tue Dec 08 16:59:43 2015 +0300 +++ b/src/http/modules/ngx_http_slice_filter_module.c Tue Dec 08 17:39:56 2015 +0300 @@ -239,6 +239,10 @@ return rc; } + if (r->buffered) { + return rc; + } + if (ngx_http_subrequest(r, &r->uri, &r->args, &sr, NULL, 0) != NGX_OK) { return NGX_ERROR; }