diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-10-19 16:12:13 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-10-19 16:12:13 +0000 |
commit | 801a35df3c43b4ceb88e9ad5aa69a4366d7b4051 (patch) | |
tree | 3f3b61c92a35081be83c11cdf69ebc9213e0b0e5 /src/http/ngx_http_request.c | |
parent | 7060e670f40ec36836400090529bd82c00461258 (diff) | |
download | nginx-801a35df3c43b4ceb88e9ad5aa69a4366d7b4051.tar.gz nginx-801a35df3c43b4ceb88e9ad5aa69a4366d7b4051.zip |
restore discard body handler after ngx_http_set_writer() set it to
ngx_http_test_reading(), the bug was introduced in r3050
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); |