Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

prioritization
John Hurliman 2009-10-05 16:41:19 -07:00
commit a76a1afda8
2 changed files with 40 additions and 27 deletions

View File

@ -238,7 +238,7 @@ namespace OpenSim.Framework.Servers
List<Thread> threads = ThreadTracker.GetThreads(); List<Thread> threads = ThreadTracker.GetThreads();
if (threads == null) if (threads == null)
{ {
sb.Append("Thread tracking is only enabled in DEBUG mode."); sb.Append("OpenSim thread tracking is only enabled in DEBUG mode.");
} }
else else
{ {
@ -264,6 +264,12 @@ namespace OpenSim.Framework.Servers
} }
} }
} }
int workers = 0, ports = 0, maxWorkers = 0, maxPorts = 0;
ThreadPool.GetAvailableThreads(out workers, out ports);
ThreadPool.GetMaxThreads(out maxWorkers, out maxPorts);
sb.Append(Environment.NewLine + "*** ThreadPool threads ***" + Environment.NewLine);
sb.Append("workers: " + (maxWorkers - workers) + " (" + maxWorkers + "); ports: " + (maxPorts - ports) + " (" + maxPorts + ")" + Environment.NewLine);
return sb.ToString(); return sb.ToString();
} }

View File

@ -67,43 +67,50 @@ namespace OpenSim.Server.Handlers.Grid
//m_log.DebugFormat("[XXX]: query String: {0}", body); //m_log.DebugFormat("[XXX]: query String: {0}", body);
Dictionary<string, string> request = try
ServerUtils.ParseQueryString(body);
if (!request.ContainsKey("METHOD"))
return FailureResult();
string method = request["METHOD"];
switch (method)
{ {
case "register": Dictionary<string, string> request =
return Register(request); ServerUtils.ParseQueryString(body);
case "deregister": if (!request.ContainsKey("METHOD"))
return Deregister(request); return FailureResult();
case "get_neighbours": string method = request["METHOD"];
return GetNeighbours(request);
case "get_region_by_uuid": switch (method)
return GetRegionByUUID(request); {
case "register":
return Register(request);
case "get_region_by_position": case "deregister":
return GetRegionByPosition(request); return Deregister(request);
case "get_region_by_name": case "get_neighbours":
return GetRegionByName(request); return GetNeighbours(request);
case "get_regions_by_name": case "get_region_by_uuid":
return GetRegionsByName(request); return GetRegionByUUID(request);
case "get_region_range": case "get_region_by_position":
return GetRegionRange(request); return GetRegionByPosition(request);
case "get_region_by_name":
return GetRegionByName(request);
case "get_regions_by_name":
return GetRegionsByName(request);
case "get_region_range":
return GetRegionRange(request);
}
m_log.DebugFormat("[GRID HANDLER]: unknown method {0} request {1}", method.Length, method);
}
catch (Exception e)
{
m_log.DebugFormat("[GRID HANDLER]: Exception {0}", e);
} }
m_log.DebugFormat("[GRID HANDLER]: unknown method {0} request {1}", method.Length, method);
return FailureResult(); return FailureResult();
} }