# HG changeset patch # User Igor Sysoev # Date 1247146371 0 # Node ID 87ddbe960172175e899346a4fea97d94648abdfd # Parent 40af8afab5a522b23ac4e7d2510ab14d413dbc96 fix ngx_http_send_special() for subrequests handled by perl diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c --- 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 } 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 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -2888,7 +2888,7 @@ ngx_http_upstream_finalize_request(ngx_h 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); }