Skip to content

Commit ab217b3

Browse files
senivamjansupol
authored andcommitted
proper way of removing a handler
Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
1 parent 0cca13b commit ab217b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

connectors/netty-connector/src/main/java/org/glassfish/jersey/netty/connector/JerseyExpectContinueHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
5656
if (!HttpResponseStatus.CONTINUE.equals(response.status())) {
5757
ctx.fireChannelRead(msg); //bypass the message to the next handler in line
5858
} else {
59-
ctx.pipeline().remove(this);
59+
ctx.pipeline().remove(JerseyExpectContinueHandler.class);
6060
}
6161
} else {
6262
if (!isExpected) {
63-
ctx.pipeline().remove(this);
63+
ctx.pipeline().remove(JerseyExpectContinueHandler.class);
6464
}
6565
ctx.fireChannelRead(msg); //bypass the message to the next handler in line
6666
}
@@ -94,7 +94,7 @@ CompletableFuture<HttpResponseStatus> processExpect100ContinueRequest(HttpReques
9494
: null;
9595
isExpected = expect100ContinueFuture != null;
9696
if (!isExpected) {
97-
ch.pipeline().remove(this);
97+
ch.pipeline().remove(JerseyExpectContinueHandler.class);
9898
} else {
9999
final HttpResponseStatus status = expectedFuture
100100
.get(timeout, TimeUnit.MILLISECONDS);

0 commit comments

Comments
 (0)