Fix a bug where HttpContents are freed too early
This commit is contained in:
parent
4ee11cd36f
commit
e95d3de1ff
@ -158,6 +158,7 @@ public class HttpObjectAggregator extends MessageToMessageDecoder<HttpObject> {
|
||||
CompositeByteBuf content = (CompositeByteBuf) currentMessage.data();
|
||||
|
||||
if (content.readableBytes() > maxContentLength - chunk.data().readableBytes()) {
|
||||
chunk.free();
|
||||
// TODO: Respond with 413 Request Entity Too Large
|
||||
// and discard the traffic or close the connection.
|
||||
// No need to notify the upstream handlers - just log.
|
||||
@ -208,6 +209,11 @@ public class HttpObjectAggregator extends MessageToMessageDecoder<HttpObject> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void freeInboundMessage(HttpObject msg) throws Exception {
|
||||
// decode() frees HttpContents.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeAdd(ChannelHandlerContext ctx) throws Exception {
|
||||
this.ctx = ctx;
|
||||
|
Loading…
Reference in New Issue
Block a user