Skip to content

Commit 1655a2d

Browse files
committed
Connection pool limits check should be disabled when connection pooling is disabled, close AsyncHttpClient#918
1 parent caac827 commit 1655a2d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ public ChannelManager(final AsyncHttpClientConfig config, NettyAsyncHttpProvider
127127
tooManyConnections = buildStaticIOException(String.format("Too many connections %s", config.getMaxConnections()));
128128
tooManyConnectionsPerHost = buildStaticIOException(String.format("Too many connections per host %s", config.getMaxConnectionsPerHost()));
129129
poolAlreadyClosed = buildStaticIOException("Pool is already closed");
130-
maxTotalConnectionsEnabled = config.getMaxConnections() > 0;
131-
maxConnectionsPerHostEnabled = config.getMaxConnectionsPerHost() > 0;
130+
maxTotalConnectionsEnabled = config.isAllowPoolingConnections() && config.getMaxConnections() > 0;
131+
maxConnectionsPerHostEnabled = config.isAllowPoolingConnections() && config.getMaxConnectionsPerHost() > 0;
132132

133133
if (maxTotalConnectionsEnabled) {
134134
openChannels = new CleanupChannelGroup("asyncHttpClient") {

0 commit comments

Comments
 (0)