diff options
author | Justin Clark-Casey (justincc) | 2014-05-13 22:21:20 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-05-13 22:21:20 +0100 |
commit | 4569c595bf9f56662c8d434917e78db60514396e (patch) | |
tree | 76e83873cc9f12ad3e027ad6322bd2b3c9267c44 /OpenSim/Framework | |
parent | minor: Add some method doc to IMessageTransferModule (diff) | |
download | opensim-SC_OLD-4569c595bf9f56662c8d434917e78db60514396e.zip opensim-SC_OLD-4569c595bf9f56662c8d434917e78db60514396e.tar.gz opensim-SC_OLD-4569c595bf9f56662c8d434917e78db60514396e.tar.bz2 opensim-SC_OLD-4569c595bf9f56662c8d434917e78db60514396e.tar.xz |
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
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 15 |
1 files changed, 10 insertions, 5 deletions
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; | |||
36 | using System.Net.Security; | 36 | using System.Net.Security; |
37 | using System.Reflection; | 37 | using System.Reflection; |
38 | using System.Text; | 38 | using System.Text; |
39 | using System.Threading; | ||
40 | using System.Web; | 39 | using System.Web; |
41 | using System.Xml; | 40 | using System.Xml; |
42 | using System.Xml.Serialization; | 41 | using System.Xml.Serialization; |
@@ -1092,7 +1091,7 @@ namespace OpenSim.Framework | |||
1092 | /// </returns> | 1091 | /// </returns> |
1093 | public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj) | 1092 | public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj) |
1094 | { | 1093 | { |
1095 | return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, Timeout.Infinite); | 1094 | return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, 0); |
1096 | } | 1095 | } |
1097 | 1096 | ||
1098 | /// <summary> | 1097 | /// <summary> |
@@ -1101,7 +1100,9 @@ namespace OpenSim.Framework | |||
1101 | /// <param name="verb"></param> | 1100 | /// <param name="verb"></param> |
1102 | /// <param name="requestUrl"></param> | 1101 | /// <param name="requestUrl"></param> |
1103 | /// <param name="obj"></param> | 1102 | /// <param name="obj"></param> |
1104 | /// <param name="pTimeout">Request timeout in milliseconds. Timeout.Infinite indicates no timeout.</param> | 1103 | /// <param name="pTimeout"> |
1104 | /// Request timeout in milliseconds. Timeout.Infinite indicates no timeout. If 0 is passed then the default HttpWebRequest timeout is used (100 seconds) | ||
1105 | /// </param> | ||
1105 | /// <returns> | 1106 | /// <returns> |
1106 | /// The response. If there was an internal exception or the request timed out, | 1107 | /// The response. If there was an internal exception or the request timed out, |
1107 | /// then the default(TResponse) is returned. | 1108 | /// then the default(TResponse) is returned. |
@@ -1117,7 +1118,9 @@ namespace OpenSim.Framework | |||
1117 | /// <param name="verb"></param> | 1118 | /// <param name="verb"></param> |
1118 | /// <param name="requestUrl"></param> | 1119 | /// <param name="requestUrl"></param> |
1119 | /// <param name="obj"></param> | 1120 | /// <param name="obj"></param> |
1120 | /// <param name="pTimeout">Request timeout in milliseconds. Timeout.Infinite indicates no timeout.</param> | 1121 | /// <param name="pTimeout"> |
1122 | /// Request timeout in milliseconds. Timeout.Infinite indicates no timeout. If 0 is passed then the default HttpWebRequest timeout is used (100 seconds) | ||
1123 | /// </param> | ||
1121 | /// <param name="maxConnections"></param> | 1124 | /// <param name="maxConnections"></param> |
1122 | /// <returns> | 1125 | /// <returns> |
1123 | /// The response. If there was an internal exception or the request timed out, | 1126 | /// The response. If there was an internal exception or the request timed out, |
@@ -1139,7 +1142,9 @@ namespace OpenSim.Framework | |||
1139 | 1142 | ||
1140 | WebRequest request = WebRequest.Create(requestUrl); | 1143 | WebRequest request = WebRequest.Create(requestUrl); |
1141 | HttpWebRequest ht = (HttpWebRequest)request; | 1144 | HttpWebRequest ht = (HttpWebRequest)request; |
1142 | ht.Timeout = pTimeout; | 1145 | |
1146 | if (pTimeout != 0) | ||
1147 | ht.Timeout = pTimeout; | ||
1143 | 1148 | ||
1144 | if (maxConnections > 0 && ht.ServicePoint.ConnectionLimit < maxConnections) | 1149 | if (maxConnections > 0 && ht.ServicePoint.ConnectionLimit < maxConnections) |
1145 | ht.ServicePoint.ConnectionLimit = maxConnections; | 1150 | ht.ServicePoint.ConnectionLimit = maxConnections; |