From 5d1871a8a016cf1d039b88b37b8b41d1d6f047be Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Mon, 8 Jun 2015 07:43:54 +0000 Subject: [PATCH] RFC 7230: increased the default max number of concurrent connection for the same route from 2 to 5 git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1684110 13f79535-47bb-0310-9956-ffa450edef68 --- .../http/impl/conn/PoolingHttpClientConnectionManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java b/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java index b840d37d9..e77402398 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/PoolingHttpClientConnectionManager.java @@ -100,6 +100,9 @@ public class PoolingHttpClientConnectionManager private final Log log = LogFactory.getLog(getClass()); + public static final int DEFAULT_MAX_TOTAL_CONNECTIONS = 25; + public static final int DEFAULT_MAX_CONNECTIONS_PER_ROUTE = 5; + private final ConfigData configData; private final CPool pool; private final HttpClientConnectionOperator connectionOperator; @@ -172,7 +175,9 @@ public class PoolingHttpClientConnectionManager super(); this.configData = new ConfigData(); this.pool = new CPool(new InternalConnectionFactory( - this.configData, connFactory), 2, 20, timeToLive, tunit); + this.configData, connFactory), + DEFAULT_MAX_CONNECTIONS_PER_ROUTE, DEFAULT_MAX_TOTAL_CONNECTIONS, + timeToLive, tunit); this.pool.setValidateAfterInactivity(2000); this.connectionOperator = Args.notNull(httpClientConnectionOperator, "HttpClientConnectionOperator"); this.isShutDown = new AtomicBoolean(false);