From 801a35df3c43b4ceb88e9ad5aa69a4366d7b4051 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 19 Oct 2009 16:12:13 +0000 Subject: restore discard body handler after ngx_http_set_writer() set it to ngx_http_test_reading(), the bug was introduced in r3050 --- src/http/ngx_http_request.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/http/ngx_http_request.c') 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); -- cgit v1.2.3