[#7599][Web]: Use original uri to compute service point hash.
authorMartin Baulig <martin.baulig@xamarin.com>
Sun, 21 Oct 2012 16:32:42 +0000 (18:32 +0200)
committerMartin Baulig <martin.baulig@xamarin.com>
Sun, 21 Oct 2012 16:56:13 +0000 (18:56 +0200)
Use the original request Uri, not the proxy address, to compute
the service point hash.

mcs/class/System/System.Net/ServicePointManager.cs

index 0fb1e9ae0253b552d41ff943a1dff12ccd1274b8..754ecd79fc57804d147d1888e6a706b057d8bb86 100644 (file)
@@ -303,6 +303,8 @@ namespace System.Net
                                throw new ArgumentNullException ("address");
 
                        RecycleServicePoints ();
+
+                       var origAddress = new Uri (address.Scheme + "://" + address.Authority);
                        
                        bool usesProxy = false;
                        bool useConnect = false;
@@ -321,7 +323,7 @@ namespace System.Net
                        
                        ServicePoint sp = null;
                        lock (servicePoints) {
-                               SPKey key = new SPKey (address, useConnect);
+                               SPKey key = new SPKey (origAddress, useConnect);
                                sp = servicePoints [key] as ServicePoint;
                                if (sp != null)
                                        return sp;