HttpChunk is mutable so no need to create a new chunk

This commit is contained in:
Trustin Lee 2010-03-31 03:02:20 +00:00
parent b210c36ef9
commit 8eb353eb5d

View File

@ -108,10 +108,8 @@ public abstract class HttpContentDecoder extends SimpleChannelUpstreamHandler {
if (!c.isLast()) {
content = decode(content);
if (content.readable()) {
// Note that HttpChunk is immutable unlike HttpMessage.
// XXX API inconsistency? I can live with it though.
Channels.fireMessageReceived(
ctx, new DefaultHttpChunk(content), e.getRemoteAddress());
c.setContent(content);
ctx.sendUpstream(e);
}
} else {
ChannelBuffer lastProduct = finishDecode();