[#2006] Correctly handle HttpMessage / HttpContent implementations

This commit is contained in:
Norman Maurer 2013-11-26 10:57:24 +01:00
parent 98845cb392
commit 10e3651bf8

View File

@ -149,8 +149,13 @@ public abstract class HttpContentEncoder extends MessageToMessageCodec<HttpReque
} else { } else {
out.add(res); out.add(res);
state = State.AWAIT_CONTENT; state = State.AWAIT_CONTENT;
if (!(msg instanceof HttpContent)) {
// only break out the switch statement if we have not content to process
// See https://github.com/netty/netty/issues/2006
break; break;
} }
// Fall through to encode the content
}
} }
case AWAIT_CONTENT: { case AWAIT_CONTENT: {
ensureContent(msg); ensureContent(msg);