diff options
Diffstat (limited to 'mcs/class/System/System.Net/ServicePointManager.cs')
-rw-r--r-- | mcs/class/System/System.Net/ServicePointManager.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mcs/class/System/System.Net/ServicePointManager.cs b/mcs/class/System/System.Net/ServicePointManager.cs index a6d456293e..27e9893a80 100644 --- a/mcs/class/System/System.Net/ServicePointManager.cs +++ b/mcs/class/System/System.Net/ServicePointManager.cs @@ -326,7 +326,8 @@ namespace System.Net if (address == null) throw new ArgumentNullException ("address"); - RecycleServicePoints (); + if ((servicePoints.Count % 4) == 0) + RecycleServicePoints (); var origAddress = new Uri (address.Scheme + "://" + address.Authority); @@ -346,8 +347,8 @@ namespace System.Net address = new Uri (address.Scheme + "://" + address.Authority); ServicePoint sp = null; + SPKey key = new SPKey (origAddress, usesProxy ? address : null, useConnect); lock (servicePoints) { - SPKey key = new SPKey (origAddress, usesProxy ? address : null, useConnect); sp = servicePoints [key] as ServicePoint; if (sp != null) return sp; |