]> git.kaiwu.me - nginx.git/commitdiff
enable lingering close for pipelined requests
authorIgor Sysoev <igor@sysoev.ru>
Mon, 1 Aug 2011 11:08:57 +0000 (11:08 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 1 Aug 2011 11:08:57 +0000 (11:08 +0000)
patch by Maxim Dounin

src/http/ngx_http_request.c

index 167bc715a2c26d1f33d472fe551cb27a0c5e9ec9..3a21111fad71c859b119d8d663472b15d0ae0fe2 100644 (file)
@@ -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;
     }