X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem%2FSystem.Net%2FServicePointManager.cs;fp=mcs%2Fclass%2FSystem%2FSystem.Net%2FServicePointManager.cs;h=66cdc7296feca5dbcbccaa586ad7deceeaf7d01f;hb=f462bcc9447abf3f0f2a336cbf5d94756311cf57;hp=26578856fae1beb3bc182f186d22811ce8103be5;hpb=6759817ac2e685efb728883a5ff96e8535ced60c;p=mono.git diff --git a/mcs/class/System/System.Net/ServicePointManager.cs b/mcs/class/System/System.Net/ServicePointManager.cs index 26578856fae..66cdc7296fe 100644 --- a/mcs/class/System/System.Net/ServicePointManager.cs +++ b/mcs/class/System/System.Net/ServicePointManager.cs @@ -264,7 +264,6 @@ namespace System.Net throw new ArgumentException ("value"); maxServicePoints = value; - RecycleServicePoints (); } } @@ -329,9 +328,6 @@ namespace System.Net if (address == null) throw new ArgumentNullException ("address"); - if ((servicePoints.Count % 4) == 0) - RecycleServicePoints (); - var origAddress = new Uri (address.Scheme + "://" + address.Authority); bool usesProxy = false; @@ -378,41 +374,6 @@ namespace System.Net return sp; } - // Internal Methods - - static void RecycleServicePoints () - { - lock (servicePoints) { - var toRemove = new ArrayList (); - var idleList = new SortedDictionary (); - IDictionaryEnumerator e = servicePoints.GetEnumerator (); - while (e.MoveNext ()) { - ServicePoint sp = (ServicePoint) e.Value; - DateTime idleSince; - if (sp.CheckAvailableForRecycling (out idleSince)) { - toRemove.Add (e.Key); - continue; - } - - while (idleList.ContainsKey (idleSince)) - idleSince = idleSince.AddMilliseconds (1); - idleList.Add (idleSince, sp); - } - - for (int i = 0; i < toRemove.Count; i++) - servicePoints.Remove (toRemove [i]); - - if (maxServicePoints == 0 || servicePoints.Count <= maxServicePoints) - return; - - // get rid of the ones with the longest idle time - foreach (var sp in idleList.Values) { - if (servicePoints.Count <= maxServicePoints) - break; - servicePoints.Remove (sp); - } - } - } #if SECURITY_DEP internal class ChainValidationHelper { object sender;