summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2021-09-10 12:59:22 +0300
committerRoman Arutyunyan <arut@nginx.com>2021-09-10 12:59:22 +0300
commitadbd28b7a9843ebce895f9903f19c5a740d61db4 (patch)
tree0d6af875614318f2a04d7a0a25fab23137116adf
parent8165597cf6b52d0129057185e19e37a83621c51e (diff)
downloadnginx-adbd28b7a9843ebce895f9903f19c5a740d61db4.tar.gz
Request body: do not create temp file if there's nothing to write.
Do this only when the entire request body is empty and r->request_body_in_file_only is set. The issue manifested itself with missing warning "a client request body is buffered to a temporary file" when the entire rb->buf is full and all buffers are delayed by a filter.
-rw-r--r--src/http/ngx_http_request_body.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c
index 89a4c7492..ad3549f98 100644
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -1309,7 +1309,7 @@ ngx_http_request_body_save_filter(ngx_http_request_t *r, ngx_chain_t *in)
if (rb->rest > 0) {
- if (rb->buf && rb->buf->last == rb->buf->end
+ if (rb->bufs && rb->buf && rb->buf->last == rb->buf->end
&& ngx_http_write_request_body(r) != NGX_OK)
{
return NGX_HTTP_INTERNAL_SERVER_ERROR;