aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_request_body.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c
index 18a58d876..d46a54c4a 100644
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -277,20 +277,6 @@ ngx_http_do_read_client_request_body(ngx_http_request_t *r)
return rc;
}
- /* write to file */
-
- if (ngx_http_write_request_body(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- /* update chains */
-
- rc = ngx_http_request_body_filter(r, NULL);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
if (rb->busy != NULL) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
@@ -1100,5 +1086,13 @@ ngx_http_request_body_save_filter(ngx_http_request_t *r, ngx_chain_t *in)
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
+ if (rb->rest > 0
+ && rb->buf && rb->buf->last == rb->buf->end)
+ {
+ if (ngx_http_write_request_body(r) != NGX_OK) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
+ }
+
return NGX_OK;
}