You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by rg...@apache.org on 2009/05/12 01:45:29 UTC

svn commit: r773724 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java

Author: rgoers
Date: Mon May 11 23:45:29 2009
New Revision: 773724

URL: http://svn.apache.org/viewvc?rev=773724&view=rev
Log:
Wait until proxy is set before calling connection manager

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java?rev=773724&r1=773723&r2=773724&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpClientFactory.java Mon May 11 23:45:29 2009
@@ -65,14 +65,10 @@
             HttpConnectionManagerParams connectionMgrParams = mgr.getParams();
 
             client = new HttpClient(mgr);
-            //client = new HttpClient(new ThreadLocalHttpConnectionManager());
 
             final HostConfiguration config = new HostConfiguration();
             config.setHost(hostname, port, scheme);
 
-            connectionMgrParams.setMaxConnectionsPerHost(config, builder.getMaxConnectionsPerHost(fileSystemOptions));
-            connectionMgrParams.setMaxTotalConnections(builder.getMaxTotalConnections(fileSystemOptions));
-
             if (fileSystemOptions != null)
             {
                 String proxyHost = builder.getProxyHost(fileSystemOptions);
@@ -109,6 +105,13 @@
                     client.getState().addCookies(cookies);
                 }
             }
+            /**
+             * ConnectionManager set methodsmust be called after the host & port and proxy host & port
+             * are set in the HostConfiguration. They are all used as part of the key when HttpConnectionManagerParams
+             * tries to locate the host configuration.
+             */
+            connectionMgrParams.setMaxConnectionsPerHost(config, builder.getMaxConnectionsPerHost(fileSystemOptions));
+            connectionMgrParams.setMaxTotalConnections(builder.getMaxTotalConnections(fileSystemOptions));
 
             client.setHostConfiguration(config);