From: Gonzalo Paniagua Javier Date: Tue, 24 Apr 2012 08:52:22 +0000 (-0400) Subject: Avoid deadlocking when getting the ServicePoint X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=9007f5e0439d345a3fa99cf0448d0bfebf947389;p=mono.git 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. --- diff --git a/mcs/class/System/System.Net/HttpWebRequest.cs b/mcs/class/System/System.Net/HttpWebRequest.cs index 483e2b81dbd..86342a53680 100644 --- a/mcs/class/System/System.Net/HttpWebRequest.cs +++ b/mcs/class/System/System.Net/HttpWebRequest.cs @@ -553,6 +553,10 @@ namespace System.Net public ServicePoint ServicePoint { get { return GetServicePoint (); } } + + internal ServicePoint ServicePointNoLock { + get { return servicePoint; } + } public override int Timeout { get { return timeout; } diff --git a/mcs/class/System/System.Net/ServicePointManager.cs b/mcs/class/System/System.Net/ServicePointManager.cs index 16292185200..3e35e93a867 100644 --- a/mcs/class/System/System.Net/ServicePointManager.cs +++ b/mcs/class/System/System.Net/ServicePointManager.cs @@ -540,7 +540,7 @@ namespace System.Net 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);