Skip to content

Commit d394db5

Browse files
committed
Use keepalive on 401.
If client requests keepalive and server allows it, reuse the socket
1 parent ddab1c7 commit d394db5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/ning/http/client/providers/netty/NettyAsyncHttpProvider.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,6 +2103,9 @@ public Object call() throws Exception {
21032103
}
21042104
};
21052105

2106+
if (future.getKeepAlive()) {
2107+
future.setReuseChannel(true);
2108+
}
21062109
if (future.getKeepAlive() && response.isChunked()) {
21072110
// We must make sure there is no bytes left before executing the next request.
21082111
ctx.setAttachment(ac);

0 commit comments

Comments
 (0)