Skip to content

Commit 0f66c2d

Browse files
author
Stephane Landelle
committed
Make sure channel is active when trying to offer
1 parent 15451ae commit 0f66c2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/ChannelManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ protected void initChannel(Channel ch) throws Exception {
242242
}
243243

244244
public final void tryToOfferChannelToPool(Channel channel, boolean keepAlive, String partitionId) {
245-
if (keepAlive && channel.isActive()) {
245+
if (channel.isActive() && keepAlive && channel.isActive()) {
246246
LOGGER.debug("Adding key: {} for channel {}", partitionId, channel);
247247
channelPool.offer(channel, partitionId);
248248
if (maxConnectionsPerHostEnabled)

0 commit comments

Comments
 (0)