aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/WebUtil.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/WebUtil.cs')
-rw-r--r--OpenSim/Framework/WebUtil.cs20
1 files changed, 16 insertions, 4 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index 9d70f63..d04a3df 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -142,17 +142,22 @@ namespace OpenSim.Framework
142 /// </summary> 142 /// </summary>
143 public static OSDMap PutToService(string url, OSDMap data) 143 public static OSDMap PutToService(string url, OSDMap data)
144 { 144 {
145 return ServiceOSDRequest(url,data,"PUT",10000); 145 return ServiceOSDRequest(url,data,"PUT", 20000);
146 } 146 }
147 147
148 public static OSDMap PostToService(string url, OSDMap data) 148 public static OSDMap PostToService(string url, OSDMap data)
149 { 149 {
150 return ServiceOSDRequest(url,data,"POST",10000); 150 return PostToService(url, data, 20000);
151 }
152
153 public static OSDMap PostToService(string url, OSDMap data, int timeout)
154 {
155 return ServiceOSDRequest(url,data,"POST", timeout);
151 } 156 }
152 157
153 public static OSDMap GetFromService(string url) 158 public static OSDMap GetFromService(string url)
154 { 159 {
155 return ServiceOSDRequest(url,null,"GET",10000); 160 return ServiceOSDRequest(url,null,"GET", 20000);
156 } 161 }
157 162
158 public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout) 163 public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout)
@@ -279,7 +284,7 @@ namespace OpenSim.Framework
279 /// </summary> 284 /// </summary>
280 public static OSDMap PostToService(string url, NameValueCollection data) 285 public static OSDMap PostToService(string url, NameValueCollection data)
281 { 286 {
282 return ServiceFormRequest(url,data,10000); 287 return ServiceFormRequest(url,data, 20000);
283 } 288 }
284 289
285 public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout) 290 public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout)
@@ -898,11 +903,18 @@ namespace OpenSim.Framework
898 /// the request. You'll want to make sure you deal with this as they're not uncommon</exception> 903 /// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
899 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj) 904 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
900 { 905 {
906 return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, 0);
907 }
908
909 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout)
910 {
901 Type type = typeof(TRequest); 911 Type type = typeof(TRequest);
902 TResponse deserial = default(TResponse); 912 TResponse deserial = default(TResponse);
903 913
904 WebRequest request = WebRequest.Create(requestUrl); 914 WebRequest request = WebRequest.Create(requestUrl);
905 request.Method = verb; 915 request.Method = verb;
916 if (pTimeout != 0)
917 request.Timeout = pTimeout * 1000;
906 918
907 if ((verb == "POST") || (verb == "PUT")) 919 if ((verb == "POST") || (verb == "PUT"))
908 { 920 {