]> git.kaiwu.me - nginx.git/commitdiff
r2080 merge:
authorIgor Sysoev <igor@sysoev.ru>
Mon, 7 Jul 2008 12:01:35 +0000 (12:01 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 7 Jul 2008 12:01:35 +0000 (12:01 +0000)
fix error when response parsed by sub filter, then by SSI filter
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 5f01bb52289c4faa2b60bbc914ae44ee4167cc28..2a0e99fa42d00245cfe55b585b7a2ef2df791926 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 663a9f5b73a8f386132b377356ec41cdd573fef6..9b4df2e7a2ea4e99044bec8df5677e67e578e0f7 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;