aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-06-17 09:29:15 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-06-17 09:29:15 +0000
commitdef1e7439fe14d343368e372b611891f976e4c5e (patch)
treecd1ce0bf9f3c6e86d9398239ca0a6f17e9dc6ec6 /src
parentb5f30a87c5401528f28ea93fe80acf4fd8017478 (diff)
downloadnginx-def1e7439fe14d343368e372b611891f976e4c5e.tar.gz
nginx-def1e7439fe14d343368e372b611891f976e4c5e.zip
if subrequest response was buffered in file, then subrequest was finalized
with 0 code, ngx_http_writer() was not set, and response part in file was lost
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_copy_filter_module.c4
-rw-r--r--src/http/ngx_http_upstream.c13
2 files changed, 15 insertions, 2 deletions
diff --git a/src/http/ngx_http_copy_filter_module.c b/src/http/ngx_http_copy_filter_module.c
index c96dbfa76..3069779c2 100644
--- a/src/http/ngx_http_copy_filter_module.c
+++ b/src/http/ngx_http_copy_filter_module.c
@@ -117,6 +117,10 @@ ngx_http_copy_filter(ngx_http_request_t *r, ngx_chain_t *in)
r->buffered |= NGX_HTTP_COPY_BUFFERED;
}
+ if (r != r->main) {
+ r->out = ctx->in;
+ }
+
#if (NGX_DEBUG)
ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"copy filter: %i \"%V?%V\"", rc, &r->uri, &r->args);
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 392783664..c1bae266c 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2157,8 +2157,17 @@ 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) {
- rc = ngx_http_send_special(r, NGX_HTTP_LAST);
+ if (rc == 0) {
+ if (r == r->main) {
+ if (!r->post_action) {
+ rc = ngx_http_send_special(r, NGX_HTTP_LAST);
+ }
+
+ } else {
+ if (r->out) {
+ rc = NGX_AGAIN;
+ }
+ }
}
ngx_http_finalize_request(r, rc);