aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2011-08-29 12:45:03 +0000
committerIgor Sysoev <igor@sysoev.ru>2011-08-29 12:45:03 +0000
commit65a179b308bf5a472de4c7a2a20dba08a69651e7 (patch)
tree456cb9c196a839d03b5c759173fd7a0ab5fbc4ab /src/http/ngx_http_request.c
parent6bf8152c6cf9aef27609e51645a452e229c67588 (diff)
downloadnginx-65a179b308bf5a472de4c7a2a20dba08a69651e7.tar.gz
nginx-65a179b308bf5a472de4c7a2a20dba08a69651e7.zip
Merge of r3982, r3984, r3985, r3991:
Lingering closing related fixes: *) lingering_close "off|on|always" *) enable lingering close for pipelined requests *) do not send RST on normal lingering close read timeout, if reset_timedout_connection is on
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 167bc715a..d11b13e4a 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -2142,8 +2142,14 @@ ngx_http_finalize_connection(ngx_http_request_t *r)
{
ngx_http_set_keepalive(r);
return;
+ }
- } else if (r->lingering_close && clcf->lingering_timeout > 0) {
+ if (clcf->lingering_close == NGX_HTTP_LINGERING_ALWAYS
+ || (clcf->lingering_close == NGX_HTTP_LINGERING_ON
+ && (r->lingering_close
+ || r->header_in->pos < r->header_in->last
+ || r->connection->read->ready)))
+ {
ngx_http_set_lingering_close(r);
return;
}
@@ -2769,7 +2775,6 @@ ngx_http_lingering_close_handler(ngx_event_t *rev)
"http lingering close handler");
if (rev->timedout) {
- c->timedout = 1;
ngx_http_close_request(r, 0);
return;
}