diff options
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 1697eefae..1e0362107 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -991,7 +991,7 @@ void ngx_http_finalize_request(ngx_http_request_t *r, int rc) clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); if (!ngx_terminate - && !ngx_quit + && !ngx_exiting && r->keepalive != 0 && clcf->keepalive_timeout > 0) { @@ -1582,6 +1582,19 @@ void ngx_http_close_request(ngx_http_request_t *r, int error) } } + if (r->request_body + && r->request_body->temp_file + && r->request_body->temp_file->file.fd != NGX_INVALID_FILE) + { + if (ngx_close_file(r->request_body->temp_file->file.fd) + == NGX_FILE_ERROR) + { + ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, + ngx_close_file_n " deleted file \"%s\" failed", + r->request_body->temp_file->file.name.data); + } + } + /* ctx->url was allocated from r->pool */ ctx = log->data; ctx->url = NULL; |