{
public class ServicePointManager
{
+ class SPKey {
+ Uri uri; // schema/host/port
+ bool use_connect;
+
+ public SPKey (Uri uri, bool use_connect) {
+ this.uri = uri;
+ this.use_connect = use_connect;
+ }
+
+ public Uri Uri {
+ get { return uri; }
+ }
+
+ public bool UseConnect {
+ get { return use_connect; }
+ }
+
+ public override int GetHashCode () {
+ return uri.GetHashCode () + ((use_connect) ? 1 : 0);
+ }
+
+ public override bool Equals (object obj) {
+ SPKey other = obj as SPKey;
+ if (obj == null) {
+ return false;
+ }
+
+ return (uri.Equals (other.uri) && other.use_connect == use_connect);
+ }
+ }
+
private static HybridDictionary servicePoints = new HybridDictionary ();
// Static properties
private static int maxServicePoints = 0;
private static bool _checkCRL = false;
private static SecurityProtocolType _securityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;
+
#if NET_1_1
+#if TARGET_JVM
+ static bool expectContinue = false;
+#else
static bool expectContinue = true;
+#endif
static bool useNagle;
#endif
foreach (ConnectionManagementElement e in s.ConnectionManagement)
manager.Add (e.Address, e.MaxConnection);
+ defaultConnectionLimit = (int) manager.GetMaxConnections ("*");
return;
}
#endif
manager = (ConnectionManagementData) ConfigurationSettings.GetConfig (configKey);
+ if (manager != null) {
+ defaultConnectionLimit = (int) manager.GetMaxConnections ("*");
+ }
}
// Constructors
}
#if NET_2_0
+ static Exception GetMustImplement ()
+ {
+ return new NotImplementedException ();
+ }
+
+ [MonoTODO]
public static int DnsRefreshTimeout
{
get {
- throw new NotImplementedException ();
+ throw GetMustImplement ();
}
set {
- throw new NotImplementedException ();
+ throw GetMustImplement ();
}
}
+ [MonoTODO]
public static bool EnableDnsRoundRobin
{
get {
- throw new NotImplementedException ();
+ throw GetMustImplement ();
}
set {
- throw new NotImplementedException ();
+ throw GetMustImplement ();
}
}
#endif
set { _securityProtocol = value; }
}
-#if NET_2_0
+#if NET_2_0 && SECURITY_DEP
+ [MonoTODO]
public static RemoteCertificateValidationCallback ServerCertificateValidationCallback
{
get {
- throw new NotImplementedException ();
+ throw GetMustImplement ();
}
set {
- throw new NotImplementedException ();
+ throw GetMustImplement ();
}
}
#endif
{
return FindServicePoint (new Uri(uriString), proxy);
}
-
+
public static ServicePoint FindServicePoint (Uri address, IWebProxy proxy)
{
if (address == null)
ServicePoint sp = null;
lock (servicePoints) {
- int key = address.GetHashCode () + (int) ((useConnect) ? 1 : 0);
+ SPKey key = new SPKey (address, useConnect);
sp = servicePoints [key] as ServicePoint;
if (sp != null)
return sp;