From 2f3668b59b0a4235713488c4a79ea61bcf4d4e83 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 1 Aug 2011 11:08:57 +0000 Subject: [PATCH] enable lingering close for pipelined requests patch by Maxim Dounin --- src/http/ngx_http_request.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 167bc715a..3a21111fa 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -2143,7 +2143,11 @@ ngx_http_finalize_connection(ngx_http_request_t *r) ngx_http_set_keepalive(r); return; - } else if (r->lingering_close && clcf->lingering_timeout > 0) { + } else if (clcf->lingering_timeout > 0 + && (r->lingering_close + || r->header_in->pos < r->header_in->last + || r->connection->read->ready)) + { ngx_http_set_lingering_close(r); return; }