changeset 6321:bc9ea464e354

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.
author Roman Arutyunyan <arut@nginx.com>
date Tue, 08 Dec 2015 17:39:56 +0300
parents a6902a941279
children 4f0f4f02c98f
files src/http/modules/ngx_http_slice_filter_module.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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_requ
         return rc;
     }
 
+    if (r->buffered) {
+        return rc;
+    }
+
     if (ngx_http_subrequest(r, &r->uri, &r->args, &sr, NULL, 0) != NGX_OK) {
         return NGX_ERROR;
     }