Couple of questions about HttpMessageDecoder

"이희승 (Trustin Lee)" trustin at gmail.com
Mon Jan 10 00:40:29 EST 2011


Hi Bruno,

Yes, your assumption is correct. :-) The current implementation always
generate an HttpRequest object with no content when
HttpRequest.isChunked() returns true, as described in the Javadoc:

    /**
     * Returns {@code true} if and only if this message does not have
     * any content but the {@link HttpChunk}s, which is generated by
     * {@link HttpMessageDecoder} consecutively, contain the actual
     * content.
     * ...
     */
    boolean isChunked();

HTH,
Trustin

On 11/16/2010 11:27 PM, brunodecarvalho wrote:
> 
> I need to write this little HTTP server that before accepting (for instance)
> a POST, needs to check the headers. Only after this check should the rest of
> the body be consumed (or the connection shut down).
> 
> I know that HttpMessageDecoder can split long non-chunked HTTP if the size
> is bigger than a given (customizable) threshold.
> My question is when this split occurs, does it *always* generate an
> HttpRequest object that contains only request line + headers and then
> generates HttpChunk for the content, or can the HttpRequest object itself
> also contain some leading data?
> 
> I've never observed this latter scenario in hotpotato but I'd like to be
> sure :)
> 
> 
> Cheers,
>   Bruno

-- 
Trustin Lee, http://gleamynode.net/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 294 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20110110/71456c82/attachment-0001.bin 


More information about the netty-users mailing list