]> git.kaiwu.me - nginx.git/commitdiff
fix error when response parsed by sub filter, then by SSI filter
authorIgor Sysoev <igor@sysoev.ru>
Mon, 30 Jun 2008 19:10:06 +0000 (19:10 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 30 Jun 2008 19:10:06 +0000 (19:10 +0000)
and some response parts are output as file buffers

src/http/modules/ngx_http_ssi_filter_module.c
src/http/modules/ngx_http_sub_filter_module.c

index a855868c4169ba62d97fc84cd67a5d3ed9e08166..d8fc8f3fcf4ba091ce86846b83197d8ab179f6e0 100644 (file)
@@ -558,8 +558,9 @@ ngx_http_ssi_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
                     if (b->in_file) {
                         if (slcf->min_file_chunk < (size_t) (b->last - b->pos))
                         {
-                            b->file_last = b->file_pos + (b->last - b->start);
-                            b->file_pos += b->pos - b->start;
+                            b->file_last = b->file_pos
+                                                   + (b->last - ctx->buf->pos);
+                            b->file_pos += b->pos - ctx->buf->pos;
 
                         } else {
                             b->in_file = 0;
index 6a9bb1c59f101de1fd1880680c24924fbe51a24b..e45ca6e4913c2c5a50122408ae8fb8404538ef94 100644 (file)
@@ -322,8 +322,8 @@ ngx_http_sub_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
                 b->recycled = 0;
 
                 if (b->in_file) {
-                    b->file_last = b->file_pos + (b->last - b->start);
-                    b->file_pos += b->pos - b->start;
+                    b->file_last = b->file_pos + (b->last - ctx->buf->pos);
+                    b->file_pos += b->pos - ctx->buf->pos;
                 }
 
                 cl->next = NULL;