aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/WebUtil.cs
diff options
context:
space:
mode:
authorUbitUmarov2017-05-30 08:20:58 +0100
committerUbitUmarov2017-05-30 08:20:58 +0100
commite5bebe3a3215bac1d5d54602ded7859860470aa0 (patch)
tree54eda12df94413dd4a95756f0365f7c43b7a8d77 /OpenSim/Framework/WebUtil.cs
parentchange servicePoint dns expire also to 5min, let the endpoints expire slide. ... (diff)
downloadopensim-SC-e5bebe3a3215bac1d5d54602ded7859860470aa0.zip
opensim-SC-e5bebe3a3215bac1d5d54602ded7859860470aa0.tar.gz
opensim-SC-e5bebe3a3215bac1d5d54602ded7859860470aa0.tar.bz2
opensim-SC-e5bebe3a3215bac1d5d54602ded7859860470aa0.tar.xz
webrequests serialiazation per endpoint its now ServicePointManager job
Diffstat (limited to 'OpenSim/Framework/WebUtil.cs')
-rw-r--r--OpenSim/Framework/WebUtil.cs55
1 files changed, 1 insertions, 54 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index 12f58fe..7b085d0 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -72,11 +72,6 @@ namespace OpenSim.Framework
72 public static int RequestNumber { get; set; } 72 public static int RequestNumber { get; set; }
73 73
74 /// <summary> 74 /// <summary>
75 /// Control where OSD requests should be serialized per endpoint.
76 /// </summary>
77 public static bool SerializeOSDRequestsPerEndpoint { get; set; }
78
79 /// <summary>
80 /// this is the header field used to communicate the local request id 75 /// this is the header field used to communicate the local request id
81 /// used for performance and debugging 76 /// used for performance and debugging
82 /// </summary> 77 /// </summary>
@@ -98,31 +93,6 @@ namespace OpenSim.Framework
98 /// </remarks> 93 /// </remarks>
99 public const int MaxRequestDiagLength = 200; 94 public const int MaxRequestDiagLength = 200;
100 95
101 /// <summary>
102 /// Dictionary of end points
103 /// </summary>
104 private static Dictionary<string,object> m_endpointSerializer = new Dictionary<string,object>();
105
106 private static object EndPointLock(string url)
107 {
108 System.Uri uri = new System.Uri(url);
109 string endpoint = string.Format("{0}:{1}",uri.Host,uri.Port);
110
111 lock (m_endpointSerializer)
112 {
113 object eplock = null;
114
115 if (! m_endpointSerializer.TryGetValue(endpoint,out eplock))
116 {
117 eplock = new object();
118 m_endpointSerializer.Add(endpoint,eplock);
119 // m_log.WarnFormat("[WEB UTIL] add a new host to end point serializer {0}",endpoint);
120 }
121
122 return eplock;
123 }
124 }
125
126 #region JSONRequest 96 #region JSONRequest
127 97
128 /// <summary> 98 /// <summary>
@@ -154,21 +124,6 @@ namespace OpenSim.Framework
154 return ServiceOSDRequest(url, null, "GET", timeout, false, false); 124 return ServiceOSDRequest(url, null, "GET", timeout, false, false);
155 } 125 }
156 126
157 public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout, bool compressed, bool rpc)
158 {
159 if (SerializeOSDRequestsPerEndpoint)
160 {
161 lock (EndPointLock(url))
162 {
163 return ServiceOSDRequestWorker(url, data, method, timeout, compressed, rpc);
164 }
165 }
166 else
167 {
168 return ServiceOSDRequestWorker(url, data, method, timeout, compressed, rpc);
169 }
170 }
171
172 public static void LogOutgoingDetail(Stream outputStream) 127 public static void LogOutgoingDetail(Stream outputStream)
173 { 128 {
174 LogOutgoingDetail("", outputStream); 129 LogOutgoingDetail("", outputStream);
@@ -222,7 +177,7 @@ namespace OpenSim.Framework
222 LogOutgoingDetail(string.Format("RESPONSE {0}: ", reqnum), input); 177 LogOutgoingDetail(string.Format("RESPONSE {0}: ", reqnum), input);
223 } 178 }
224 179
225 private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed, bool rpc) 180 public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout, bool compressed, bool rpc)
226 { 181 {
227 int reqnum = RequestNumber++; 182 int reqnum = RequestNumber++;
228 183
@@ -422,14 +377,6 @@ namespace OpenSim.Framework
422 377
423 public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout) 378 public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout)
424 { 379 {
425 lock (EndPointLock(url))
426 {
427 return ServiceFormRequestWorker(url,data,timeout);
428 }
429 }
430
431 private static OSDMap ServiceFormRequestWorker(string url, NameValueCollection data, int timeout)
432 {
433 int reqnum = RequestNumber++; 380 int reqnum = RequestNumber++;
434 string method = (data != null && data["RequestMethod"] != null) ? data["RequestMethod"] : "unknown"; 381 string method = (data != null && data["RequestMethod"] != null) ? data["RequestMethod"] : "unknown";
435 382