Welcome! Log In Create A New Profile

Advanced

[nginx] Upstream: disable body cleanup with preserve_output (ticket #1565).

Maxim Dounin
December 04, 2018 08:38AM
details: https://hg.nginx.org/nginx/rev/17ee239ae2e6
branches: stable-1.14
changeset: 7409:17ee239ae2e6
user: Maxim Dounin <mdounin@mdounin.ru>
date: Wed Jun 13 15:28:11 2018 +0300
description:
Upstream: disable body cleanup with preserve_output (ticket #1565).

With u->conf->preserve_output set the request body file might be used
after the response header is sent, so avoid cleaning it. (Normally
this is not a problem as u->conf->preserve_output is only set with
r->request_body_no_buffering, but the request body might be already
written to a file in a different context.)

diffstat:

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

diffs (13 lines):

diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2901,7 +2901,8 @@ ngx_http_upstream_send_response(ngx_http
}

if (r->request_body && r->request_body->temp_file
- && r == r->main && !r->preserve_body)
+ && r == r->main && !r->preserve_body
+ && !u->conf->preserve_output)
{
ngx_pool_run_cleanup_file(r->pool, r->request_body->temp_file->file.fd);
r->request_body->temp_file->file.fd = NGX_INVALID_FILE;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Upstream: disable body cleanup with preserve_output (ticket #1565).

Maxim Dounin 28 December 04, 2018 08:38AM



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

Online Users

Guests: 94
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready