From 3627984c9ded50c8f9f7e4aaa653b172de2bacb1 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Tue, 5 Feb 2013 12:39:21 +0000 Subject: [PATCH] PoolingClientConnectionManager does not use ClientConnectionOperator#createConnection() method to create new connections git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1442566 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/http/impl/conn/HttpConnPool.java | 12 ++++++++++-- .../impl/conn/PoolingClientConnectionManager.java | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java b/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java index c0fbd09e0..b55a87420 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/HttpConnPool.java @@ -31,6 +31,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import org.apache.commons.logging.Log; +import org.apache.http.conn.ClientConnectionOperator; import org.apache.http.conn.OperatedClientConnection; import org.apache.http.conn.routing.HttpRoute; import org.apache.http.pool.AbstractConnPool; @@ -51,9 +52,10 @@ class HttpConnPool extends AbstractConnPool { + private final ClientConnectionOperator connOperator; + + InternalConnFactory(final ClientConnectionOperator connOperator) { + this.connOperator = connOperator; + } + public OperatedClientConnection create(final HttpRoute route) throws IOException { - return new DefaultClientConnection(); + return connOperator.createConnection(); } } diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/PoolingClientConnectionManager.java b/httpclient/src/main/java/org/apache/http/impl/conn/PoolingClientConnectionManager.java index a4692613c..f703b3617 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/PoolingClientConnectionManager.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/PoolingClientConnectionManager.java @@ -111,7 +111,7 @@ public class PoolingClientConnectionManager implements ClientConnectionManager, this.schemeRegistry = schemeRegistry; this.dnsResolver = dnsResolver; this.operator = createConnectionOperator(schemeRegistry); - this.pool = new HttpConnPool(this.log, 2, 20, timeToLive, tunit); + this.pool = new HttpConnPool(this.log, this.operator, 2, 20, timeToLive, tunit); } @Override