diff options
author | Igor Sysoev <igor@sysoev.ru> | 2007-10-01 16:24:15 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2007-10-01 16:24:15 +0000 |
commit | d13045f16cb8ad94f666c3a704c552cd3ae13492 (patch) | |
tree | eff89dc31dfc995f79675f614c6005eccb2afecb /src | |
parent | fa928a6c6692d0d2cfa3d223ceb412b46c872eeb (diff) | |
download | nginx-d13045f16cb8ad94f666c3a704c552cd3ae13492.tar.gz nginx-d13045f16cb8ad94f666c3a704c552cd3ae13492.zip |
fix empty string replacement in sub_filter
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_sub_filter_module.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/http/modules/ngx_http_sub_filter_module.c b/src/http/modules/ngx_http_sub_filter_module.c index d196c1966..a9fe8d407 100644 --- 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_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; |