]> git.kaiwu.me - nginx.git/commitdiff
fix empty string replacement in sub_filter
authorIgor Sysoev <igor@sysoev.ru>
Mon, 1 Oct 2007 16:24:15 +0000 (16:24 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 1 Oct 2007 16:24:15 +0000 (16:24 +0000)
src/http/modules/ngx_http_sub_filter_module.c

index d196c1966dbdb2c2f1d8ba544ba98743d6332752..a9fe8d40706c88135adea4b26d2e5fca16fdd5b1 100644 (file)
@@ -369,9 +369,14 @@ ngx_http_sub_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
                 }
             }
 
-            b->memory = 1;
-            b->pos = ctx->sub.data;
-            b->last = ctx->sub.data + ctx->sub.len;
+            if (ctx->sub.len) {
+                b->memory = 1;
+                b->pos = ctx->sub.data;
+                b->last = ctx->sub.data + ctx->sub.len;
+
+            } else {
+                b->sync = 1;
+            }
 
             cl->buf = b;
             cl->next = NULL;