netty/netty — pull request #1787 by d-t-w (2013-08-27 08:45:40+00:00)
Title: HTTP Chunk, wrong delimiter written

CRLF_BUF is being created from ZERO_CRLF rather than CRLF.

This has the effect of appending a 0 to every chunked HTTP content.

Below is a diff of the trace of two curl requests to a simple Netty Http Server which echoes input back to the client. The text sent is "hello". In both cases the request header "Accept-Encoding: gzip" is sent.

The first request is against 4.0.7-final, the second against 4.0.8-final. You can see the second has two extra bytes and a problem with the encoded chunked data.

< <= Recv data, 47 bytes (0x2f)
---
> <= Recv data, 49 bytes (0x31)
42,47c42,47
< 0004: ...........H.........
< 001b: a
< 001e: .....6....
< 002a: 0
< 002d:
< == Info: Connection #0 to host 127.0.0.1 left intact
---
> 0004: ...........H.........0
> 001c: a
> 001f: .....6....0
> 002c: 0
> 002f:
> == Info: Problem (3) in the Chunked-Encoded data