Skip to content

Commit 5de0c96

Browse files
committed
Revert back AsyncHttpClient#844 and detach channel in finishUpdate, close AsyncHttpClient#844
1 parent beb6b1a commit 5de0c96

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/main/java/com/ning/http/client/providers/netty/future/NettyResponseFuture.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,11 @@ public void attachChannel(Channel channel, boolean reuseChannel) {
389389
this.reuseChannel = reuseChannel;
390390
}
391391

392+
public void detachChannel() {
393+
this.channel = null;
394+
this.reuseChannel = false;
395+
}
396+
392397
public Channel channel() {
393398
return channel;
394399
}

src/main/java/com/ning/http/client/providers/netty/handler/HttpProtocol.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,15 @@ private void addType3NTLMAuthorizationHeader(String auth, FluentCaseInsensitiveS
181181

182182
private void finishUpdate(final NettyResponseFuture<?> future, Channel channel, boolean expectOtherChunks) throws IOException {
183183

184-
markAsDone(future, channel);
184+
future.detachChannel();
185185

186186
boolean keepAlive = future.isKeepAlive();
187187
if (expectOtherChunks && keepAlive)
188188
channelManager.drainChannelAndOffer(channel, future);
189189
else
190190
channelManager.tryToOfferChannelToPool(channel, keepAlive, future.getPartition());
191+
192+
markAsDone(future, channel);
191193
}
192194

193195
private boolean updateBodyAndInterrupt(NettyResponseFuture<?> future, AsyncHandler<?> handler, NettyResponseBodyPart bodyPart)

0 commit comments

Comments
 (0)