aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorUbitUmarov2016-11-23 19:30:55 +0000
committerUbitUmarov2016-11-23 19:30:55 +0000
commitb3eda582ec44ee375a116b91887ddb1bf7c22917 (patch)
tree4ff6d69362a87db3a496f00b411371311ebc3432 /OpenSim/Framework
parent fix maturity on parcelInfo (diff)
downloadopensim-SC_OLD-b3eda582ec44ee375a116b91887ddb1bf7c22917.zip
opensim-SC_OLD-b3eda582ec44ee375a116b91887ddb1bf7c22917.tar.gz
opensim-SC_OLD-b3eda582ec44ee375a116b91887ddb1bf7c22917.tar.bz2
opensim-SC_OLD-b3eda582ec44ee375a116b91887ddb1bf7c22917.tar.xz
add to SynchronousRestFormsRequester a keepalive disable option, and make use of it on some friends conns
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/WebUtil.cs15
1 files changed, 4 insertions, 11 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index 2bbf785..f927e69 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -1019,7 +1019,8 @@ namespace OpenSim.Framework
1019 /// 1019 ///
1020 /// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting 1020 /// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
1021 /// the request. You'll want to make sure you deal with this as they're not uncommon</exception> 1021 /// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
1022 public static string MakeRequest(string verb, string requestUrl, string obj, int timeoutsecs, IServiceAuth auth) 1022 public static string MakeRequest(string verb, string requestUrl, string obj, int timeoutsecs = -1,
1023 IServiceAuth auth = null, bool keepalive = true)
1023 { 1024 {
1024 int reqnum = WebUtil.RequestNumber++; 1025 int reqnum = WebUtil.RequestNumber++;
1025 1026
@@ -1034,6 +1035,8 @@ namespace OpenSim.Framework
1034 request.Method = verb; 1035 request.Method = verb;
1035 if (timeoutsecs > 0) 1036 if (timeoutsecs > 0)
1036 request.Timeout = timeoutsecs * 1000; 1037 request.Timeout = timeoutsecs * 1000;
1038 if(!keepalive && request is HttpWebRequest)
1039 ((HttpWebRequest)request).KeepAlive = false;
1037 1040
1038 if (auth != null) 1041 if (auth != null)
1039 auth.AddAuthorization(request.Headers); 1042 auth.AddAuthorization(request.Headers);
@@ -1125,16 +1128,6 @@ namespace OpenSim.Framework
1125 return respstring; 1128 return respstring;
1126 } 1129 }
1127 1130
1128 public static string MakeRequest(string verb, string requestUrl, string obj, int timeoutsecs)
1129 {
1130 return MakeRequest(verb, requestUrl, obj, timeoutsecs, null);
1131 }
1132
1133 public static string MakeRequest(string verb, string requestUrl, string obj)
1134 {
1135 return MakeRequest(verb, requestUrl, obj, -1);
1136 }
1137
1138 public static string MakeRequest(string verb, string requestUrl, string obj, IServiceAuth auth) 1131 public static string MakeRequest(string verb, string requestUrl, string obj, IServiceAuth auth)
1139 { 1132 {
1140 return MakeRequest(verb, requestUrl, obj, -1, auth); 1133 return MakeRequest(verb, requestUrl, obj, -1, auth);