Fixed a problem where HttpMessageDecoder doesn't finish decoding immediately when content-length is 0 (or there's no content)

This commit is contained in:
Trustin Lee 2008-11-30 16:29:35 +00:00
parent 7b69bf371b
commit e213b54b71

View File

@ -73,6 +73,10 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDec
} }
case READ_HEADER: { case READ_HEADER: {
readHeaders(buffer); readHeaders(buffer);
if (message.getContentLength() == 0) {
content = ChannelBuffers.EMPTY_BUFFER;
return reset();
}
//we return null here, this forces decode to be called again where we will decode the content //we return null here, this forces decode to be called again where we will decode the content
return null; return null;
} }