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
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);
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);