Skip to content

Commit

Permalink
Release the incoming message when the decoding failed
Browse files Browse the repository at this point in the history
Related to #406
  • Loading branch information
violetagg committed Aug 6, 2018
1 parent 88462b0 commit c7c9132
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
Throwable cause = decoderResult.cause();
HttpServerOperations.log.debug(format(ctx.channel(), "Decoding failed: " + msg + " : "),
cause);
ReferenceCountUtil.release(msg);

HttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_0,
cause instanceof TooLongFrameException ? HttpResponseStatus.REQUEST_ENTITY_TOO_LARGE:
Expand Down

0 comments on commit c7c9132

Please sign in to comment.