From 2e9542b9106144e534bc79b8b1589908f73fa4b5 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Thu, 9 Jul 2009 13:32:51 +0000 Subject: [PATCH] fix ngx_http_send_special() for subrequests handled by perl --- src/http/ngx_http_request.c | 8 +++++++- src/http/ngx_http_upstream.c | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 57128a361..d60384fe1 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -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) { diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index add5b21d9..cc303b431 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -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); }