]> git.kaiwu.me - nginx.git/commitdiff
Sub filter: flush buffers handling.
authorMaxim Dounin <mdounin@mdounin.ru>
Thu, 25 Jul 2013 10:54:47 +0000 (14:54 +0400)
committerMaxim Dounin <mdounin@mdounin.ru>
Thu, 25 Jul 2013 10:54:47 +0000 (14:54 +0400)
src/http/modules/ngx_http_sub_filter_module.c

index 6a14dbdc2ef2946324b9d5ccf527d8fd47cf85a5..3d32b0fbc92b997283cca87401edfa8b01c8d7d4 100644 (file)
@@ -369,7 +369,9 @@ ngx_http_sub_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
             continue;
         }
 
-        if (ctx->buf->last_buf || ngx_buf_in_memory(ctx->buf)) {
+        if (ctx->buf->last_buf || ctx->buf->flush
+            || ngx_buf_in_memory(ctx->buf))
+        {
             if (b == NULL) {
                 cl = ngx_chain_get_free_buf(r->pool, &ctx->free);
                 if (cl == NULL) {
@@ -387,6 +389,7 @@ ngx_http_sub_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
             }
 
             b->last_buf = ctx->buf->last_buf;
+            b->flush = ctx->buf->flush;
             b->shadow = ctx->buf;
 
             b->recycled = ctx->buf->recycled;