From 9007f5e0439d345a3fa99cf0448d0bfebf947389 Mon Sep 17 00:00:00 2001 From: Gonzalo Paniagua Javier Date: Tue, 24 Apr 2012 04:52:22 -0400 Subject: [PATCH] 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. --- mcs/class/System/System.Net/HttpWebRequest.cs | 4 ++++ mcs/class/System/System.Net/ServicePointManager.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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); -- 2.25.1