changeset 1555:76fe59c6fafb

fix empty string replacement in sub_filter
author Igor Sysoev <igor@sysoev.ru>
date Mon, 01 Oct 2007 16:24:15 +0000
parents 30fcc8478d85
children 3dc408adbb70
files src/http/modules/ngx_http_sub_filter_module.c
diffstat 1 files changed, 8 insertions(+), 3 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,9 +369,14 @@ ngx_http_sub_body_filter(ngx_http_reques
                 }
             }
 
-            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;