Welcome! Log In Create A New Profile

Advanced

[nginx] Request body: do not create temp file if there's nothing to write.

Roman Arutyunyan
September 14, 2021 07:34AM
details: https://hg.nginx.org/nginx/rev/97cf8284fd19
branches:
changeset: 7928:97cf8284fd19
user: Roman Arutyunyan <arut@nginx.com>
date: Fri Sep 10 12:59:22 2021 +0300
description:
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.

diffstat:

src/http/ngx_http_request_body.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 7189cb2b4c5d -r 97cf8284fd19 src/http/ngx_http_request_body.c
--- a/src/http/ngx_http_request_body.c Tue Sep 14 12:12:02 2021 +0300
+++ b/src/http/ngx_http_request_body.c Fri Sep 10 12:59:22 2021 +0300
@@ -1309,7 +1309,7 @@ ngx_http_request_body_save_filter(ngx_ht

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;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Request body: do not create temp file if there's nothing to write.

Roman Arutyunyan 447 September 14, 2021 07:34AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 177
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready