diff options
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 485a56469..bad89a4aa 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -2105,10 +2105,15 @@ ngx_http_finalize_connection(ngx_http_request_t *r) if (r->main->count != 1) { - if (r->discard_body && r->lingering_time == 0) { - r->lingering_time = ngx_time() + if (r->discard_body) { + r->read_event_handler = ngx_http_discarded_request_body_handler; + r->write_event_handler = ngx_http_request_empty_handler; + + if (r->lingering_time == 0) { + r->lingering_time = ngx_time() + (time_t) (clcf->lingering_time / 1000); - ngx_add_timer(r->connection->read, clcf->lingering_timeout); + ngx_add_timer(r->connection->read, clcf->lingering_timeout); + } } ngx_http_close_request(r, 0); |