comparison src/http/ngx_http_upstream.c @ 7297:a10e5fe44762

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.)
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 13 Jun 2018 15:28:11 +0300
parents 08f114ed5449
children 8eab05b83dde abe1b60c4213
comparison
equal deleted inserted replaced
7296:8e6bb4e6045f 7297:a10e5fe44762
2899 2899
2900 u->pipe->downstream_error = 1; 2900 u->pipe->downstream_error = 1;
2901 } 2901 }
2902 2902
2903 if (r->request_body && r->request_body->temp_file 2903 if (r->request_body && r->request_body->temp_file
2904 && r == r->main && !r->preserve_body) 2904 && r == r->main && !r->preserve_body
2905 && !u->conf->preserve_output)
2905 { 2906 {
2906 ngx_pool_run_cleanup_file(r->pool, r->request_body->temp_file->file.fd); 2907 ngx_pool_run_cleanup_file(r->pool, r->request_body->temp_file->file.fd);
2907 r->request_body->temp_file->file.fd = NGX_INVALID_FILE; 2908 r->request_body->temp_file->file.fd = NGX_INVALID_FILE;
2908 } 2909 }
2909 2910