]> git.kaiwu.me - nginx.git/commitdiff
fix ngx_http_send_special() for subrequests handled by perl
authorIgor Sysoev <igor@sysoev.ru>
Thu, 9 Jul 2009 13:32:51 +0000 (13:32 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 9 Jul 2009 13:32:51 +0000 (13:32 +0000)
src/http/ngx_http_request.c
src/http/ngx_http_upstream.c

index 57128a361be1611c5fd3a5016e636c6c43d51016..d60384fe18cf7e54e3146484b88c6cea87fe0103 100644 (file)
@@ -2694,7 +2694,13 @@ ngx_http_send_special(ngx_http_request_t *r, ngx_uint_t flags)
     }
 
     if (flags & NGX_HTTP_LAST) {
-        b->last_buf = 1;
+
+        if (r == r->main && !r->post_action) {
+            b->last_buf = 1;
+
+        } else {
+            b->last_in_chain = 1;
+        }
     }
 
     if (flags & NGX_HTTP_FLUSH) {
index add5b21d9cbff1a8a82c4d89f0f598e321cf818b..cc303b4313efdfb3c8c6ff924d52285dce9a7097 100644 (file)
@@ -2888,7 +2888,7 @@ ngx_http_upstream_finalize_request(ngx_http_request_t *r,
 
     r->connection->log->action = "sending to client";
 
-    if (rc == 0 && r == r->main && !r->post_action) {
+    if (rc == 0) {
         rc = ngx_http_send_special(r, NGX_HTTP_LAST);
     }