[#1046] Make sure HttpContentEncoder calls ByteBuf.retain() if needed
This commit is contained in:
parent
1cc04e7dda
commit
fcba55329c
@ -129,10 +129,12 @@ public abstract class HttpContentEncoder extends MessageToMessageCodec<HttpMessa
|
||||
Result result = beginEncode(message, c, acceptEncoding);
|
||||
|
||||
if (result == null) {
|
||||
ByteBuf data = c.data();
|
||||
data.retain();
|
||||
if (c instanceof LastHttpContent) {
|
||||
return new Object[] { message, new DefaultLastHttpContent(c.data()) };
|
||||
return new Object[] { message, new DefaultLastHttpContent(data) };
|
||||
} else {
|
||||
return new Object[] { message, new DefaultHttpContent(c.data()) };
|
||||
return new Object[] { message, new DefaultHttpContent(data) };
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user