Browse files

Avoid deadlocking when getting the ServicePoint

	SSL connections were deadlocking when getting the service point for the
	connection in the last few releases of 2.10.x and in master.

	Fixes bug #4599.
  • Loading branch information...
1 parent 8847bd4 commit 9007f5e0439d345a3fa99cf0448d0bfebf947389 @gonzalop gonzalop committed Apr 24, 2012
View
4 mcs/class/System/System.Net/HttpWebRequest.cs
@@ -553,6 +553,10 @@ static bool CheckValidHost (string scheme, string val)
public ServicePoint ServicePoint {
get { return GetServicePoint (); }
}
+
+ internal ServicePoint ServicePointNoLock {
+ get { return servicePoint; }
+ }
public override int Timeout {
get { return timeout; }
View
2 mcs/class/System/System.Net/ServicePointManager.cs
@@ -540,7 +540,7 @@ internal ValidationResult ValidateChain (Mono.Security.X509.X509CertificateColle
ServicePoint sp = null;
HttpWebRequest req = sender as HttpWebRequest;
if (req != null)
- sp = req.ServicePoint;
+ sp = req.ServicePointNoLock;
if (status11 == 0 && errors != 0)
status11 = GetStatusFromChain (chain);

0 comments on commit 9007f5e

Please sign in to comment.