[#963] Fix invalid free-up of messages if they are only passed-throught in HttpContentEncoder and HttpContentDecoder
This commit is contained in:
parent
082b5f0dff
commit
29bed32a89
@ -114,6 +114,15 @@ public abstract class HttpContentDecoder extends MessageToMessageDecoder<Object>
|
|||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void freeInboundMessage(Object msg) throws Exception {
|
||||||
|
if (decoder == null) {
|
||||||
|
// if the decoder was null we returned the original message so we are not allowed to free it
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.freeInboundMessage(msg);
|
||||||
|
}
|
||||||
|
|
||||||
private Object[] decodeContent(HttpMessage header, HttpContent c) {
|
private Object[] decodeContent(HttpMessage header, HttpContent c) {
|
||||||
ByteBuf newContent = Unpooled.buffer();
|
ByteBuf newContent = Unpooled.buffer();
|
||||||
ByteBuf content = c.data();
|
ByteBuf content = c.data();
|
||||||
|
@ -161,6 +161,20 @@ public abstract class HttpContentEncoder extends MessageToMessageCodec<HttpMessa
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void freeOutboundMessage(Object msg) throws Exception {
|
||||||
|
if (encoder == null) {
|
||||||
|
// if the decoder was null we returned the original message so we are not allowed to free it
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.freeOutboundMessage(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void freeInboundMessage(HttpMessage msg) throws Exception {
|
||||||
|
// not free it as it is only passed through
|
||||||
|
}
|
||||||
|
|
||||||
private Object[] encodeContent(HttpMessage header, HttpContent c) {
|
private Object[] encodeContent(HttpMessage header, HttpContent c) {
|
||||||
ByteBuf newContent = Unpooled.buffer();
|
ByteBuf newContent = Unpooled.buffer();
|
||||||
ByteBuf content = c.data();
|
ByteBuf content = c.data();
|
||||||
|
Loading…
Reference in New Issue
Block a user