Skip to content

Commit 9ffcc98

Browse files
committed
Netty HttpProtocol.finishUpdate should offer channel back to pool after markAsDone, close AsyncHttpClient#844
1 parent f508174 commit 9ffcc98

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,13 @@ 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);
185+
184186
boolean keepAlive = future.isKeepAlive();
185187
if (expectOtherChunks && keepAlive)
186188
channelManager.drainChannelAndOffer(channel, future);
187189
else
188190
channelManager.tryToOfferChannelToPool(channel, keepAlive, future.getPartition());
189-
markAsDone(future, channel);
190191
}
191192

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

0 commit comments

Comments
 (0)