Skip to content

Commit

Permalink
Remove calling of keepAliveHandler.destroy() as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
ikhoon committed Aug 1, 2024
1 parent d10019d commit 91e814b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ private void onWrapperCompleted(HttpResponseWrapper resWrapper, @Nullable Throwa
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {}

@Override
public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
keepAliveHandler.destroy();
}
public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {}

@Override
public void channelRegistered(ChannelHandlerContext ctx) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,6 @@ Http2ResponseDecoder responseDecoder() {
return responseDecoder;
}

@Override
public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
super.handlerAdded(ctx);
}

@Override
protected void handlerRemoved0(ChannelHandlerContext ctx) throws Exception {
destroyKeepAliveHandler();
super.handlerRemoved0(ctx);
}

@Override
public void channelRegistered(ChannelHandlerContext ctx) throws Exception {
super.channelRegistered(ctx);
}

@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
super.channelActive(ctx);
Expand All @@ -100,14 +84,4 @@ protected boolean needsImmediateDisconnection() {
return responseDecoder.goAwayHandler().receivedErrorGoAway() ||
keepAliveHandler().isClosing();
}

@Override
public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
destroyKeepAliveHandler();
super.channelInactive(ctx);
}

private void destroyKeepAliveHandler() {
keepAliveHandler().destroy();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -631,12 +631,6 @@ public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
name = ctx.name();
}

@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
keepAliveHandler.destroy();
super.channelInactive(ctx);
}

@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
keepAliveHandler.onReadOrWrite();
Expand Down

0 comments on commit 91e814b

Please sign in to comment.