Skip to content

Commit 89a811a

Browse files
committed
tryToOfferChannelToPool shouldn't mark channel as discard after offering to pool, close AsyncHttpClient#834
1 parent 51764e7 commit 89a811a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/ning/http/client/providers/netty/channel/ChannelManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ protected String getTargetContentEncoding(String contentEncoding) throws Excepti
285285
public final void tryToOfferChannelToPool(Channel channel, boolean keepAlive, String partition) {
286286
if (channel.isConnected() && keepAlive && channel.isReadable()) {
287287
LOGGER.debug("Adding key: {} for channel {}", partition, channel);
288+
Channels.setDiscard(channel);
288289
channelPool.offer(channel, partition);
289290
if (maxConnectionsPerHostEnabled)
290291
channelId2Partition.putIfAbsent(channel.getId(), partition);
291-
Channels.setDiscard(channel);
292292
} else {
293293
// not offered
294294
closeChannel(channel);

0 commit comments

Comments
 (0)