Possible error in implementation of ReplayingDecoderBuffer::readableBytes() causing empty HTTP 200 OK response to be always chunked
"이희승 (Trustin Lee)"
trustin at gmail.com
Wed Jul 7 03:29:42 EDT 2010
ReplayingDecoderBuffer assumes that there is infinite data is available
unless the connection is closed. That's why readableBytes() returns a
very large number. If a decoder tries to read more than what's actually
in the buffer, an exception is raised internally and decode() will be
called again when more data is available.
If an HTTP response does not have any 'Content-Length' or
'Transfer-Encoding' header, it means the content (body) will be streamed
untill the disconnection. Since we don't know what the connection will
be closed, we don't know the length of the streamed content. At this
point, buf.readableBytes() will be a very large number which is greater
than maxChunkSize, and therefore, the content will be split into
multiple chunks to avoid decode problem.
RtspMessageDecoder and its subtypes behave a little bit differently.
They assume there's no content if 'Content-Length' header is missing.
HTH,
Trustin
--
what we call human nature in actuality is human habit
http://gleamynode.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 293 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20100707/54401617/attachment.bin
More information about the netty-users
mailing list