HttpChunk is mutable so no need to create a new chunk

This commit is contained in:
Trustin Lee 2010-03-31 03:02:58 +00:00
parent 8eb353eb5d
commit 3f7fff3fa5

View File

@ -133,10 +133,8 @@ public abstract class HttpContentEncoder extends SimpleChannelHandler {
if (!c.isLast()) {
content = encode(content);
if (content.readable()) {
// Note that HttpChunk is immutable unlike HttpMessage.
// XXX API inconsistency? I can live with it though.
Channels.write(
ctx, e.getFuture(), new DefaultHttpChunk(content), e.getRemoteAddress());
c.setContent(content);
ctx.sendDownstream(e);
}
} else {
ChannelBuffer lastProduct = finishEncode();