aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2009-10-05 16:06:21 -0700
committerDiva Canto2009-10-05 16:06:21 -0700
commit2753f4d62c79b45f5ad1b3e275d7a9c628d34687 (patch)
tree6c4123680f293d5fd76346b2b57eb1cb714cd784
parentMake sure that keys exist in arrays before trying to access them. (diff)
downloadopensim-SC_OLD-2753f4d62c79b45f5ad1b3e275d7a9c628d34687.zip
opensim-SC_OLD-2753f4d62c79b45f5ad1b3e275d7a9c628d34687.tar.gz
opensim-SC_OLD-2753f4d62c79b45f5ad1b3e275d7a9c628d34687.tar.bz2
opensim-SC_OLD-2753f4d62c79b45f5ad1b3e275d7a9c628d34687.tar.xz
* GridServerPostHandler.cs: Try/catch in Handle
* BaseOpenSimServer.cs: Added thread pool numbers in show threads
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs8
-rw-r--r--OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs55
2 files changed, 38 insertions, 25 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 632b551..56155dd 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -238,7 +238,7 @@ namespace OpenSim.Framework.Servers
238 List<Thread> threads = ThreadTracker.GetThreads(); 238 List<Thread> threads = ThreadTracker.GetThreads();
239 if (threads == null) 239 if (threads == null)
240 { 240 {
241 sb.Append("Thread tracking is only enabled in DEBUG mode."); 241 sb.Append("OpenSim thread tracking is only enabled in DEBUG mode.");
242 } 242 }
243 else 243 else
244 { 244 {
@@ -264,6 +264,12 @@ namespace OpenSim.Framework.Servers
264 } 264 }
265 } 265 }
266 } 266 }
267 int workers = 0, ports = 0, maxWorkers = 0, maxPorts = 0;
268 ThreadPool.GetAvailableThreads(out workers, out ports);
269 ThreadPool.GetMaxThreads(out maxWorkers, out maxPorts);
270
271 sb.Append(Environment.NewLine + "*** ThreadPool threads ***" + Environment.NewLine);
272 sb.Append("workers: " + (maxWorkers - workers) + " (" + maxWorkers + "); ports: " + (maxPorts - ports) + " (" + maxPorts + ")" + Environment.NewLine);
267 273
268 return sb.ToString(); 274 return sb.ToString();
269 } 275 }
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
index 17a31bc..433ed0b 100644
--- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
@@ -67,43 +67,50 @@ namespace OpenSim.Server.Handlers.Grid
67 67
68 //m_log.DebugFormat("[XXX]: query String: {0}", body); 68 //m_log.DebugFormat("[XXX]: query String: {0}", body);
69 69
70 Dictionary<string, string> request = 70 try
71 ServerUtils.ParseQueryString(body); 71 {
72 Dictionary<string, string> request =
73 ServerUtils.ParseQueryString(body);
72 74
73 if (!request.ContainsKey("METHOD")) 75 if (!request.ContainsKey("METHOD"))
74 return FailureResult(); 76 return FailureResult();
75 77
76 string method = request["METHOD"]; 78 string method = request["METHOD"];
77 79
78 switch (method) 80 switch (method)
79 { 81 {
80 case "register": 82 case "register":
81 return Register(request); 83 return Register(request);
82 84
83 case "deregister": 85 case "deregister":
84 return Deregister(request); 86 return Deregister(request);
85 87
86 case "get_neighbours": 88 case "get_neighbours":
87 return GetNeighbours(request); 89 return GetNeighbours(request);
88 90
89 case "get_region_by_uuid": 91 case "get_region_by_uuid":
90 return GetRegionByUUID(request); 92 return GetRegionByUUID(request);
91 93
92 case "get_region_by_position": 94 case "get_region_by_position":
93 return GetRegionByPosition(request); 95 return GetRegionByPosition(request);
94 96
95 case "get_region_by_name": 97 case "get_region_by_name":
96 return GetRegionByName(request); 98 return GetRegionByName(request);
97 99
98 case "get_regions_by_name": 100 case "get_regions_by_name":
99 return GetRegionsByName(request); 101 return GetRegionsByName(request);
100 102
101 case "get_region_range": 103 case "get_region_range":
102 return GetRegionRange(request); 104 return GetRegionRange(request);
103 105
106 }
107 m_log.DebugFormat("[GRID HANDLER]: unknown method {0} request {1}", method.Length, method);
108 }
109 catch (Exception e)
110 {
111 m_log.DebugFormat("[GRID HANDLER]: Exception {0}", e);
104 } 112 }
105 113
106 m_log.DebugFormat("[GRID HANDLER]: unknown method {0} request {1}", method.Length, method);
107 return FailureResult(); 114 return FailureResult();
108 115
109 } 116 }