diff src/http/modules/ngx_http_range_filter_module.c @ 6722:6136a51f9c21

Do not set last_buf flag in subrequests. The last_buf flag should only be set in the last buffer of the main request. Otherwise, several last_buf flags can appear in output. This can, for example, break the chunked filter, which will include several final chunks in output.
author Roman Arutyunyan <arut@nginx.com>
date Mon, 03 Oct 2016 20:48:51 +0300
parents f01ab2dbcfdc
children 2decd6b34306
line wrap: on
line diff
--- a/src/http/modules/ngx_http_range_filter_module.c
+++ b/src/http/modules/ngx_http_range_filter_module.c
@@ -750,7 +750,8 @@ ngx_http_range_singlepart_body(ngx_http_
                 buf->last -= (size_t) (last - range->end);
             }
 
-            buf->last_buf = 1;
+            buf->last_buf = (r == r->main) ? 1 : 0;
+            buf->last_in_chain = 1;
             *ll = cl;
             cl->next = NULL;