From 4569c595bf9f56662c8d434917e78db60514396e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 13 May 2014 22:21:20 +0100 Subject: Fix behaviour change in recent commit bbc1dc6 so that SynchronousRestObjectRequester.MakeRequest() calls with no timeout specified use the default HttpWebRequest timeout as previously. I mistakenly thought that that default request timeout was inifite rather than 100 seconds, restoring previously behaviour. As per http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.timeout%28v=vs.100%29.aspx Relates to http://opensimulator.org/mantis/view.php?id=7165 --- OpenSim/Framework/WebUtil.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 3b73520..0970fd1 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -36,7 +36,6 @@ using System.Net; using System.Net.Security; using System.Reflection; using System.Text; -using System.Threading; using System.Web; using System.Xml; using System.Xml.Serialization; @@ -1092,7 +1091,7 @@ namespace OpenSim.Framework /// public static TResponse MakeRequest(string verb, string requestUrl, TRequest obj) { - return MakeRequest(verb, requestUrl, obj, Timeout.Infinite); + return MakeRequest(verb, requestUrl, obj, 0); } /// @@ -1101,7 +1100,9 @@ namespace OpenSim.Framework /// /// /// - /// Request timeout in milliseconds. Timeout.Infinite indicates no timeout. + /// + /// Request timeout in milliseconds. Timeout.Infinite indicates no timeout. If 0 is passed then the default HttpWebRequest timeout is used (100 seconds) + /// /// /// The response. If there was an internal exception or the request timed out, /// then the default(TResponse) is returned. @@ -1117,7 +1118,9 @@ namespace OpenSim.Framework /// /// /// - /// Request timeout in milliseconds. Timeout.Infinite indicates no timeout. + /// + /// Request timeout in milliseconds. Timeout.Infinite indicates no timeout. If 0 is passed then the default HttpWebRequest timeout is used (100 seconds) + /// /// /// /// The response. If there was an internal exception or the request timed out, @@ -1139,7 +1142,9 @@ namespace OpenSim.Framework WebRequest request = WebRequest.Create(requestUrl); HttpWebRequest ht = (HttpWebRequest)request; - ht.Timeout = pTimeout; + + if (pTimeout != 0) + ht.Timeout = pTimeout; if (maxConnections > 0 && ht.ServicePoint.ConnectionLimit < maxConnections) ht.ServicePoint.ConnectionLimit = maxConnections; -- cgit v1.1