Subject: | chunked encoding, missing extension support |
the chunked header size can be followed by extensions. The parser expects an immediate CRLF after the hex digits. it should have provision to skip the extension.
I also found that apache (for http:responses) in some cases add spaces, behind the hex digits. Would be nice to skip those too.
from the RFC
Chunked-Body = *chunk
last-chunk
trailer
CRLF
chunk = chunk-size [ chunk-extension ] CRLF
chunk-data CRLF
chunk-size = 1*HEX
last-chunk = 1*("0") [ chunk-extension ] CRLF
chunk-extension= *( ";" chunk-ext-name [ "=" chunk-ext-val ] )
chunk-ext-name = token
chunk-ext-val = token | quoted-string
chunk-data = chunk-size(OCTET)
trailer = *(entity-header CRLF)