]> git.kaiwu.me - nginx.git/commitdiff
merge r3681:
authorIgor Sysoev <igor@sysoev.ru>
Tue, 14 Dec 2010 19:34:29 +0000 (19:34 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 14 Dec 2010 19:34:29 +0000 (19:34 +0000)
update r->buffered after processing SSI command,
the bug has been probably introduced in r2378

src/http/modules/ngx_http_ssi_filter_module.c

index ced8f684330c677a6b2dd9ec2771dcdb04137047..118822f19aa1f5565abcab2ae185eaf740754825 100644 (file)
@@ -70,6 +70,8 @@ typedef enum {
 
 static ngx_int_t ngx_http_ssi_output(ngx_http_request_t *r,
     ngx_http_ssi_ctx_t *ctx);
+static void ngx_http_ssi_buffered(ngx_http_request_t *r,
+    ngx_http_ssi_ctx_t *ctx);
 static ngx_int_t ngx_http_ssi_parse(ngx_http_request_t *r,
     ngx_http_ssi_ctx_t *ctx);
 static ngx_str_t *ngx_http_ssi_get_variable(ngx_http_request_t *r,
@@ -797,6 +799,7 @@ ngx_http_ssi_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
                 }
 
                 if (rc == NGX_DONE || rc == NGX_AGAIN || rc == NGX_ERROR) {
+                    ngx_http_ssi_buffered(r, ctx);
                     return rc;
                 }
             }
@@ -949,14 +952,21 @@ ngx_http_ssi_output(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx)
         }
     }
 
+    ngx_http_ssi_buffered(r, ctx);
+
+    return rc;
+}
+
+
+static void
+ngx_http_ssi_buffered(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx)
+{
     if (ctx->in || ctx->buf) {
         r->buffered |= NGX_HTTP_SSI_BUFFERED;
 
     } else {
         r->buffered &= ~NGX_HTTP_SSI_BUFFERED;
     }
-
-    return rc;
 }