diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-10-19 14:08:09 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-10-19 14:08:09 +0000 |
commit | 2495c4d50bbdaf1410808fd230ecca820c463934 (patch) | |
tree | 8e436f49733ad910d7ff2399a19dfb72a4dd575f /src/http/ngx_http_request.c | |
parent | a1e36777f4fcb34ce90d27f2a8bf1455053bfa3a (diff) | |
download | nginx-2495c4d50bbdaf1410808fd230ecca820c463934.tar.gz nginx-2495c4d50bbdaf1410808fd230ecca820c463934.zip |
add lingering timeout if a response is short and a request body is being
discarded, 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, 9 insertions, 2 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 6c42f385c..485a56469 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -2101,13 +2101,20 @@ ngx_http_finalize_connection(ngx_http_request_t *r) { ngx_http_core_loc_conf_t *clcf; + clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); + if (r->main->count != 1) { + + if (r->discard_body && 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_http_close_request(r, 0); return; } - clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); - if (!ngx_terminate && !ngx_exiting && r->keepalive |