]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Allow chunking the last HTTP response on a connection.
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Tue, 10 May 2016 23:06:48 +0000 (17:06 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 10 May 2016 23:06:48 +0000 (17:06 -0600)
Squid should avoid signaling the message end by connection closure
because it hurts message integrity and sometimes performance. Squid
now chunks if:

  1. the response has a body;
  2. the client claims HTTP/1.1 support; and
  3. Squid is not going to send a Content-Length header.

AFAICT, Squid used to exclude to-be-closed connections from chunking
because chunking support was added (trunk r10781) specifically to
optimize persistent connection reuse and closing connections were
incorrectly excluded as a non-interesting/out-of-scope case. And/or
perhaps we did not realize the dangers of signaling the message end
by connection closure.

src/client_side_reply.cc

index 5cd5e4564caa6f88fd0534a8e4f1f103f8c53187..76d7ace9f5240d51db7c29e1d3edd3368c852123 100644 (file)
@@ -1532,9 +1532,7 @@ clientReplyContext::buildReplyHeader()
     }
 
     // Decide if we send chunked reply
-    if (maySendChunkedReply &&
-            request->flags.proxyKeepalive &&
-            reply->bodySize(request->method) < 0) {
+    if (maySendChunkedReply && reply->bodySize(request->method) < 0) {
         debugs(88, 3, "clientBuildReplyHeader: chunked reply");
         request->flags.chunkedReply = true;
         hdr->putStr(Http::HdrType::TRANSFER_ENCODING, "chunked");