Skip to content

Commit

Permalink
Request body: do not create temp file if there's nothing to write.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arut committed Sep 10, 2021
1 parent 8165597 commit adbd28b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/http/ngx_http_request_body.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit adbd28b

Please sign in to comment.