[PATCH] Send chunked responses if body size is unknown.

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Fri, 20 Aug 2010 16:28:29 -0600

Send chunked responses if body size is unknown.

Apply HTTP chunked transfer encoding to the response body if all of the
following conditions are met:

* client claims HTTP version 1.1 or later support
* response does not have a Content-Length header already
* response does not use multipart/byteranges encoding
* connection is persistent

If we decide to send chunked reply, chunked_reply flag is set. Chunked
encoding is done in ClientSocketContext::packChunk(). The last-chunk is
sent only when clientReplyContext complete flag is set.

--------

This feature was requested to make Squid work with HTTP/1.1 clients that
can handle chunked responses but cannot handle connection closures in
the middle of a transaction sequence. The earlier version of the patch
(for Squid v3.1) was tested in production.

N.B. A bug in Squid may result in server-side code not treating
premature server-side connection termination as an error. That bug
results in Squid client-side sending a complete chunked response to the
client instead of omitting the last-chunk to indicate a truncated
response. Fixing that bug is outside this project scope (but we might
have a patch for it somewhere, I need to check).

Received on Fri Aug 20 2010 - 22:28:44 MDT

This archive was generated by hypermail 2.2.0 : Sun Aug 22 2010 - 12:00:05 MDT