Author: sebb
Date: Thu Sep 22 00:19:24 2011
New Revision: 1173915

URL: http://svn.apache.org/viewvc?rev=1173915&view=rev
Log:
Bug 51863 - Lots of ESTABLISHED connections with HttpClient 4 implementation 
(ws HttpClient 3.1 impl)

Modified:
    
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
    jakarta/jmeter/trunk/xdocs/changes.xml

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java?rev=1173915&r1=1173914&r2=1173915&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
 Thu Sep 22 00:19:24 2011
@@ -358,7 +358,7 @@ public class HTTPHC4Impl extends HTTPHCA
      */
     private static final class HttpClientKey {
 
-        private final URL url;
+        private final String target; // protocol://[user:pass@]host:[port]
         private final boolean hasProxy;
         private final String proxyHost;
         private final int proxyPort;
@@ -369,7 +369,9 @@ public class HTTPHC4Impl extends HTTPHCA
 
         public HttpClientKey(URL url, boolean b, String proxyHost,
                 int proxyPort, String proxyUser, String proxyPass) {
-            this.url = url;
+            // N.B. need to separate protocol from authority otherwise 
http://server would match https://erver
+            // could use separate fields, but simpler to combine them
+            this.target = url.getProtocol()+"://"+url.getAuthority();
             this.hasProxy = b;
             this.proxyHost = proxyHost;
             this.proxyPort = proxyPort;
@@ -387,7 +389,7 @@ public class HTTPHC4Impl extends HTTPHCA
                 hash = hash*31 + getHash(proxyUser);
                 hash = hash*31 + getHash(proxyPass);
             }
-            hash = hash*31 + url.toString().hashCode();
+            hash = hash*31 + target.hashCode();
             return hash;
         }
 
@@ -412,14 +414,12 @@ public class HTTPHC4Impl extends HTTPHCA
                 this.proxyHost.equals(other.proxyHost) &&
                 this.proxyUser.equals(other.proxyUser) &&
                 this.proxyPass.equals(other.proxyPass) &&
-                this.url.toString().equals(other.url.toString());              
  
+                this.target.equals(other.target);
             }
             // No proxy, so don't check proxy fields
             return 
                 this.hasProxy == other.hasProxy &&
-                this.url.toString().equals(other.url.toString())
-            ;
-            
+                this.target.equals(other.target);
         }
 
         @Override

Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=1173915&r1=1173914&r2=1173915&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Thu Sep 22 00:19:24 2011
@@ -81,6 +81,7 @@ This can be overridden by setting the JM
 <h3>HTTP Samplers and Proxy</h3>
 <ul>
 <li>Fix HttpClient 4 sampler so it reuses HttpClient instances and connections 
where possible.</li>
+<li>Bug 51863 - Lots of ESTABLISHED connections with HttpClient 4 
implementation (ws HttpClient 3.1 impl)</li>
 <li>Bug 51750 - Retrieve all embedded resources doesn't follow IFRAME</li>
 <li>Change the default so the HttpClient 4 sampler does not retry</li>
 <li>Bug 51752 - HTTP Cache is broken when using "Retrieve all embedded 
resources" with concurrent pool</li>



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@jakarta.apache.org
For additional commands, e-mail: notifications-h...@jakarta.apache.org

Reply via email to