HTTP Content Decoder Cleanup Bug

Motiviation:
The HTTP content decoder's cleanup method is not cleaning up the decoder correctly.
The cleanup method is currently doing a readOutbound on the EmbeddedChannel but
for decoding the call should be readInbound.

Modifications:
-Change readOutbound to readInbound in the cleanup method

Result:
The cleanup method should be correctly releaseing unused resources
This commit is contained in:
Scott Mitchell 2014-09-10 08:33:32 -04:00 committed by Norman Maurer
parent b4feb7ac19
commit dce21483e3

View File

@ -203,10 +203,10 @@ public abstract class HttpContentDecoder extends MessageToMessageDecoder<HttpObj
private void cleanup() { private void cleanup() {
if (decoder != null) { if (decoder != null) {
// Clean-up the previous encoder if not cleaned up correctly. // Clean-up the previous decoder if not cleaned up correctly.
if (decoder.finish()) { if (decoder.finish()) {
for (;;) { for (;;) {
ByteBuf buf = (ByteBuf) decoder.readOutbound(); ByteBuf buf = (ByteBuf) decoder.readInbound();
if (buf == null) { if (buf == null) {
break; break;
} }