aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index a6fb08acb..f685bf348 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -921,18 +921,21 @@ 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 (r->keepalive != 0 && clcf->keepalive_timeout > 0) {
+ if (!ngx_terminate
+ && !ngx_quit
+ && r->keepalive != 0
+ && clcf->keepalive_timeout > 0)
+ {
ngx_http_set_keepalive(r);
+ return;
} else if (r->lingering_close && clcf->lingering_timeout > 0) {
ngx_http_set_lingering_close(r);
-
- } else {
- ngx_http_close_request(r, 0);
- ngx_http_close_connection(r->connection);
+ return;
}
- return;
+ ngx_http_close_request(r, 0);
+ ngx_http_close_connection(r->connection);
}