Skip to content

Commit

Permalink
Release the incoming message on the client when the decoding failed
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Aug 20, 2018
1 parent caa1adf commit 3373c66
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ protected void onInboundNext(ChannelHandlerContext ctx, Object msg) {
.isFailure()) {
onInboundError(response.decoderResult()
.cause());
ReferenceCountUtil.release(msg);
return;
}
if (started) {
Expand All @@ -555,6 +556,7 @@ protected void onInboundNext(ChannelHandlerContext ctx, Object msg) {
response.headers()
.toString());
}
ReferenceCountUtil.release(msg);
return;
}
started = true;
Expand Down Expand Up @@ -593,6 +595,7 @@ protected void onInboundNext(ChannelHandlerContext ctx, Object msg) {
log.debug(format(channel(), "HttpClientOperations received an incorrect end " +
"delimiter (previously used connection?)"));
}
ReferenceCountUtil.release(msg);
return;
}
if (log.isDebugEnabled()) {
Expand All @@ -619,6 +622,7 @@ protected void onInboundNext(ChannelHandlerContext ctx, Object msg) {
"(previously used connection?)"),
msg);
}
ReferenceCountUtil.release(msg);
return;
}
super.onInboundNext(ctx, msg);
Expand Down

0 comments on commit 3373c66

Please sign in to comment.