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.
}
// 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");