]> git.ipfire.org Git - thirdparty/squid.git/commit - src/ChunkedCodingParser.cc
Compliance: Ignore unused chunk-extensions to correctly handle large ones.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 31 Aug 2010 23:50:57 +0000 (17:50 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 31 Aug 2010 23:50:57 +0000 (17:50 -0600)
commit5c550f5f4660635437e2564187e9918d776e65b5
tree162cbbf24879a0d5730171ec338ce1a3930eeb07
parent4d919a809f1ecea8d92602407e5ef438c6c313a1
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
src/ChunkedCodingParser.cc
src/ChunkedCodingParser.h