[#1201] Correctly handle mix of not compressed and compressed requests

This commit is contained in:
Norman Maurer 2013-03-25 08:12:48 +01:00
parent 8057c699cd
commit f76e38592d
2 changed files with 13 additions and 0 deletions

View File

@ -115,12 +115,19 @@ public abstract class HttpContentDecoder extends MessageToMessageDecoder<HttpObj
return decoded;
}
if (c instanceof LastHttpContent) {
decodeStarted = false;
}
return new Object[] { message, c.retain() };
}
if (decoder != null) {
return decodeContent(null, c);
} else {
if (c instanceof LastHttpContent) {
decodeStarted = false;
}
return c.retain();
}
}
@ -213,6 +220,7 @@ public abstract class HttpContentDecoder extends MessageToMessageDecoder<HttpObj
if (decoder.finish()) {
fetchDecoderOutput(out);
}
decodeStarted = false;
decoder = null;
}

View File

@ -143,6 +143,7 @@ public abstract class HttpContentEncoder extends MessageToMessageCodec<HttpMessa
if (result == null) {
if (c instanceof LastHttpContent) {
encodeStarted = false;
return new Object[] { message, new DefaultLastHttpContent(c.data().retain()) };
} else {
return new Object[] { message, new DefaultHttpContent(c.data().retain()) };
@ -176,6 +177,10 @@ public abstract class HttpContentEncoder extends MessageToMessageCodec<HttpMessa
return encodeContent(null, c);
}
if (c instanceof LastHttpContent) {
encodeStarted = false;
}
return c.retain();
}
return null;