Compliance: Ignore unused chunk-extensions to correctly handle large ones

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Sun, 29 Aug 2010 19:03:50 -0600

Compliance: Ignore unused chunk-extensions to correctly handle large ones.

Chunk parser did not advance until it got a complete chunk-extension.
HttpStateData::maybeReadVirginBody() does not grow the buffer if there
is no space available for the [chunked] body so the transaction with a
large chunk-extension would stall. The default HttpStateData input
buffer size is just 2KB so it does not take a "very large" extension to
stall the transaction.

Somewhat ironically, we are not even interested in the HTTP
chunk-extension itself. After the change, Squid skips the
chunk-extension data as soon as it gets it (except for the last-chunk,
see below). Incrementally ignoring data requires handling quoted strings
correctly, to avoid mis-detecting a quoted CRLF. Thus, we now preserve
the quoted string parsing state in ChunkedCodingParser.

Last-chunk chunk-extension is useful for ICAP. We parse it instead of
ignoring. This parsing is done as before and may still lead to
connection hanging, but a proper fix is outside this patch scope.
Similarly, other stalling reasons are outside this patch scope.

Co-Advisor test case: test_case/rfc2616/chunked-1p0-longValExt-16385-toClt

Received on Mon Aug 30 2010 - 01:04:01 MDT

This archive was generated by hypermail 2.2.0 : Mon Aug 30 2010 - 12:00:05 MDT