changeset 5286:819c5b53d8b5

Sub filter: flush buffers handling.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 25 Jul 2013 14:54:47 +0400
parents d47ef93134e5
children 2dbc5e38b65d
files src/http/modules/ngx_http_sub_filter_module.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/modules/ngx_http_sub_filter_module.c
+++ b/src/http/modules/ngx_http_sub_filter_module.c
@@ -369,7 +369,9 @@ ngx_http_sub_body_filter(ngx_http_reques
             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_reques
             }
 
             b->last_buf = ctx->buf->last_buf;
+            b->flush = ctx->buf->flush;
             b->shadow = ctx->buf;
 
             b->recycled = ctx->buf->recycled;