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 <[email protected]>
  • Loading branch information
senivam authored and jansupol committed Oct 19, 2023
1 parent 0cca13b commit ab217b3
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 ab217b3

Please sign in to comment.