aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Servers/ServerBase.cs48
-rw-r--r--OpenSim/Framework/WebUtil.cs55
2 files changed, 2 insertions, 101 deletions
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs
index f627ae6..3bb2313 100644
--- a/OpenSim/Framework/Servers/ServerBase.cs
+++ b/OpenSim/Framework/Servers/ServerBase.cs
@@ -275,18 +275,6 @@ namespace OpenSim.Framework.Servers
275 (string module, string[] args) => Notice(GetThreadsReport())); 275 (string module, string[] args) => Notice(GetThreadsReport()));
276 276
277 m_console.Commands.AddCommand ( 277 m_console.Commands.AddCommand (
278 "Debug", false, "debug comms set",
279 "debug comms set serialosdreq true|false",
280 "Set comms parameters. For debug purposes.",
281 HandleDebugCommsSet);
282
283 m_console.Commands.AddCommand (
284 "Debug", false, "debug comms status",
285 "debug comms status",
286 "Show current debug comms parameters.",
287 HandleDebugCommsStatus);
288
289 m_console.Commands.AddCommand (
290 "Debug", false, "debug threadpool set", 278 "Debug", false, "debug threadpool set",
291 "debug threadpool set worker|iocp min|max <n>", 279 "debug threadpool set worker|iocp min|max <n>",
292 "Set threadpool parameters. For debug purposes.", 280 "Set threadpool parameters. For debug purposes.",
@@ -343,47 +331,13 @@ namespace OpenSim.Framework.Servers
343 331
344 public void RegisterCommonComponents(IConfigSource configSource) 332 public void RegisterCommonComponents(IConfigSource configSource)
345 { 333 {
346 IConfig networkConfig = configSource.Configs["Network"]; 334// IConfig networkConfig = configSource.Configs["Network"];
347
348 if (networkConfig != null)
349 {
350 WebUtil.SerializeOSDRequestsPerEndpoint = networkConfig.GetBoolean("SerializeOSDRequests", false);
351 }
352 335
353 m_serverStatsCollector = new ServerStatsCollector(); 336 m_serverStatsCollector = new ServerStatsCollector();
354 m_serverStatsCollector.Initialise(configSource); 337 m_serverStatsCollector.Initialise(configSource);
355 m_serverStatsCollector.Start(); 338 m_serverStatsCollector.Start();
356 } 339 }
357 340
358 private void HandleDebugCommsStatus(string module, string[] args)
359 {
360 Notice("serialosdreq is {0}", WebUtil.SerializeOSDRequestsPerEndpoint);
361 }
362
363 private void HandleDebugCommsSet(string module, string[] args)
364 {
365 if (args.Length != 5)
366 {
367 Notice("Usage: debug comms set serialosdreq true|false");
368 return;
369 }
370
371 if (args[3] != "serialosdreq")
372 {
373 Notice("Usage: debug comms set serialosdreq true|false");
374 return;
375 }
376
377 bool setSerializeOsdRequests;
378
379 if (!ConsoleUtil.TryParseConsoleBool(m_console, args[4], out setSerializeOsdRequests))
380 return;
381
382 WebUtil.SerializeOSDRequestsPerEndpoint = setSerializeOsdRequests;
383
384 Notice("serialosdreq is now {0}", setSerializeOsdRequests);
385 }
386
387 private void HandleShowThreadpoolCallsActive(string module, string[] args) 341 private void HandleShowThreadpoolCallsActive(string module, string[] args)
388 { 342 {
389 List<KeyValuePair<string, int>> calls = Util.GetFireAndForgetCallsInProgress().ToList(); 343 List<KeyValuePair<string, int>> calls = Util.GetFireAndForgetCallsInProgress().ToList();
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