]> git.kaiwu.me - nginx.git/commitdiff
Slice filter: terminate first slice with last_in_chain flag.
authorRoman Arutyunyan <arut@nginx.com>
Tue, 8 Dec 2015 14:39:56 +0000 (17:39 +0300)
committerRoman Arutyunyan <arut@nginx.com>
Tue, 8 Dec 2015 14:39:56 +0000 (17:39 +0300)
This flag makes sub filter flush buffered data and optimizes allocation in copy
filter.

src/http/modules/ngx_http_slice_filter_module.c

index aa2a0344cbcf6e0dd6f968822ea0c22a63a38c3b..5e149b4c189adc4c20de8aa5e726b8f71504fb7c 100644 (file)
@@ -222,6 +222,7 @@ ngx_http_slice_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
     for (cl = in; cl; cl = cl->next) {
         if (cl->buf->last_buf) {
             cl->buf->last_buf = 0;
+            cl->buf->last_in_chain = 1;
             cl->buf->sync = 1;
             ctx->last = 1;
         }