Skip to content

Commit

Permalink
Merge #3118 into 2.0.0-M4
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Mar 26, 2024
2 parents 5748ed8 + 741a8fe commit 58f8316
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1422,9 +1422,11 @@ public ChannelHandlerContext fireChannelRead(Object msg) {
}

void stopTimeouts(ChannelHandlerContext ctx) {
ChannelHandler handler = ctx.channel().pipeline().get(NettyPipeline.ReadTimeoutHandler);
if (handler != null) {
ctx.channel().pipeline().remove(handler);
if (readTimeout != null) {
ChannelHandler handler = ctx.channel().pipeline().get(NettyPipeline.ReadTimeoutHandler);
if (handler != null) {
ctx.channel().pipeline().remove(handler);
}
}
if (requestTimeoutFuture != null) {
requestTimeoutFuture.cancel();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2023 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2011-2024 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -669,7 +669,9 @@ protected void onInboundNext(ChannelHandlerContext ctx, Object msg) {
emptyLastHttpContent.close();
}
if (msg instanceof LastHttpContent) {
removeHandler(NettyPipeline.ReadTimeoutHandler);
if (readTimeout != null) {
removeHandler(NettyPipeline.ReadTimeoutHandler);
}
if (requestTimeoutFuture != null) {
requestTimeoutFuture.cancel();
requestTimeoutFuture = null;
Expand Down

0 comments on commit 58f8316

Please sign in to comment.