diff options
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 27fd15946..dd9ec2350 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -1921,8 +1921,16 @@ ngx_http_set_keepalive(ngx_http_request_t *r) c = r->connection; rev = c->read; + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); + ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "set http keepalive handler"); + if (r->discard_body) { + r->lingering_time = ngx_time() + (time_t) (clcf->lingering_time / 1000); + ngx_add_timer(rev, clcf->lingering_timeout); + return; + } + c->log->action = "closing request"; hc = r->http_connection; @@ -1966,8 +1974,6 @@ ngx_http_set_keepalive(ngx_http_request_t *r) } } - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - ngx_http_request_done(r, 0); c->data = hc; |