Skip to content

Commit

Permalink
Merge #3117 into 1.2.0-M1
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Mar 25, 2024
2 parents 99b3392 + 3ffc06a commit 287d92a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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 @@ -154,7 +154,9 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) {
}
// read message and track if it was keepAlive
if (msg instanceof HttpRequest) {
IdleTimeoutHandler.removeIdleTimeoutHandler(ctx.pipeline());
if (idleTimeout != null) {
IdleTimeoutHandler.removeIdleTimeoutHandler(ctx.pipeline());
}

final HttpRequest request = (HttpRequest) msg;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2023 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2022-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 @@ -53,7 +53,7 @@ protected void channelIdle(ChannelHandlerContext ctx, IdleStateEvent evt) {
}

static void addIdleTimeoutHandler(ChannelPipeline pipeline, @Nullable Duration idleTimeout) {
if (pipeline.get(NettyPipeline.IdleTimeoutHandler) == null && idleTimeout != null) {
if (idleTimeout != null && pipeline.get(NettyPipeline.IdleTimeoutHandler) == null) {
String baseName = null;
if (pipeline.get(NettyPipeline.HttpCodec) != null) {
baseName = NettyPipeline.HttpCodec;
Expand Down

0 comments on commit 287d92a

Please sign in to comment.