aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/WebUtil.cs27
1 files changed, 26 insertions, 1 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index 1d9e2ce..5c34cf4 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -717,6 +717,13 @@ namespace OpenSim.Framework
717 public static void MakeRequest<TRequest, TResponse>(string verb, 717 public static void MakeRequest<TRequest, TResponse>(string verb,
718 string requestUrl, TRequest obj, Action<TResponse> action) 718 string requestUrl, TRequest obj, Action<TResponse> action)
719 { 719 {
720 MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, action, 0);
721 }
722
723 public static void MakeRequest<TRequest, TResponse>(string verb,
724 string requestUrl, TRequest obj, Action<TResponse> action,
725 int maxConnections)
726 {
720 int reqnum = WebUtil.RequestNumber++; 727 int reqnum = WebUtil.RequestNumber++;
721 728
722 if (WebUtil.DebugLevel >= 3) 729 if (WebUtil.DebugLevel >= 3)
@@ -730,6 +737,10 @@ namespace OpenSim.Framework
730 Type type = typeof(TRequest); 737 Type type = typeof(TRequest);
731 738
732 WebRequest request = WebRequest.Create(requestUrl); 739 WebRequest request = WebRequest.Create(requestUrl);
740 HttpWebRequest ht = (HttpWebRequest)request;
741 if (maxConnections > 0 && ht.ServicePoint.ConnectionLimit < maxConnections)
742 ht.ServicePoint.ConnectionLimit = maxConnections;
743
733 WebResponse response = null; 744 WebResponse response = null;
734 TResponse deserial = default(TResponse); 745 TResponse deserial = default(TResponse);
735 XmlSerializer deserializer = new XmlSerializer(typeof(TResponse)); 746 XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
@@ -1036,6 +1047,16 @@ namespace OpenSim.Framework
1036 /// the request. You'll want to make sure you deal with this as they're not uncommon</exception> 1047 /// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
1037 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj) 1048 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
1038 { 1049 {
1050 return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, 0);
1051 }
1052
1053 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout)
1054 {
1055 return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, pTimeout, 0);
1056 }
1057
1058 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout, int maxConnections)
1059 {
1039 int reqnum = WebUtil.RequestNumber++; 1060 int reqnum = WebUtil.RequestNumber++;
1040 1061
1041 if (WebUtil.DebugLevel >= 3) 1062 if (WebUtil.DebugLevel >= 3)
@@ -1050,6 +1071,10 @@ namespace OpenSim.Framework
1050 TResponse deserial = default(TResponse); 1071 TResponse deserial = default(TResponse);
1051 1072
1052 WebRequest request = WebRequest.Create(requestUrl); 1073 WebRequest request = WebRequest.Create(requestUrl);
1074 HttpWebRequest ht = (HttpWebRequest)request;
1075 if (maxConnections > 0 && ht.ServicePoint.ConnectionLimit < maxConnections)
1076 ht.ServicePoint.ConnectionLimit = maxConnections;
1077
1053 request.Method = verb; 1078 request.Method = verb;
1054 MemoryStream buffer = null; 1079 MemoryStream buffer = null;
1055 1080
@@ -1172,4 +1197,4 @@ namespace OpenSim.Framework
1172 return deserial; 1197 return deserial;
1173 } 1198 }
1174 } 1199 }
1175} \ No newline at end of file 1200}