Skip to content

Commit

Permalink
proper way of removing a handler
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
  • Loading branch information
senivam committed Oct 18, 2023
1 parent b074c47 commit 6bc0812
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
if (!HttpResponseStatus.CONTINUE.equals(response.status())) {
ctx.fireChannelRead(msg); //bypass the message to the next handler in line
} else {
ctx.pipeline().remove(this);
ctx.pipeline().remove(JerseyExpectContinueHandler.class);
}
} else {
if (!isExpected) {
ctx.pipeline().remove(this);
ctx.pipeline().remove(JerseyExpectContinueHandler.class);
}
ctx.fireChannelRead(msg); //bypass the message to the next handler in line
}
Expand Down Expand Up @@ -94,7 +94,7 @@ CompletableFuture<HttpResponseStatus> processExpect100ContinueRequest(HttpReques
: null;
isExpected = expect100ContinueFuture != null;
if (!isExpected) {
ch.pipeline().remove(this);
ch.pipeline().remove(JerseyExpectContinueHandler.class);
} else {
final HttpResponseStatus status = expectedFuture
.get(timeout, TimeUnit.MILLISECONDS);
Expand Down

0 comments on commit 6bc0812

Please sign in to comment.