Added a couple of console commands to help diagnose issues:

show circuits: shows the lists of agent circuit data
show http-handlers: shows the currently registered http handlers
0.7.1-dev
Diva Canto 2011-02-05 17:57:30 -08:00
parent 3a2a48a8ca
commit b20ab1063f
2 changed files with 82 additions and 0 deletions

View File

@ -143,6 +143,11 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
} }
public List<string> GetStreamHandlerKeys()
{
return new List<string>(m_streamHandlers.Keys);
}
private static string GetHandlerKey(string httpMethod, string path) private static string GetHandlerKey(string httpMethod, string path)
{ {
return httpMethod + ":" + path; return httpMethod + ":" + path;
@ -179,6 +184,11 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
} }
public List<string> GetXmlRpcHandlerKeys()
{
return new List<string>(m_rpcHandlers.Keys);
}
public bool AddHTTPHandler(string methodName, GenericHTTPMethod handler) public bool AddHTTPHandler(string methodName, GenericHTTPMethod handler)
{ {
//m_log.DebugFormat("[BASE HTTP SERVER]: Registering {0}", methodName); //m_log.DebugFormat("[BASE HTTP SERVER]: Registering {0}", methodName);
@ -196,6 +206,12 @@ namespace OpenSim.Framework.Servers.HttpServer
return false; return false;
} }
public List<string> GetHTTPHandlerKeys()
{
return new List<string>(m_HTTPHandlers.Keys);
}
public bool AddPollServiceHTTPHandler(string methodName, GenericHTTPMethod handler, PollServiceEventArgs args) public bool AddPollServiceHTTPHandler(string methodName, GenericHTTPMethod handler, PollServiceEventArgs args)
{ {
bool pollHandlerResult = false; bool pollHandlerResult = false;
@ -214,6 +230,12 @@ namespace OpenSim.Framework.Servers.HttpServer
return false; return false;
} }
public List<string> GetPollServiceHandlerKeys()
{
return new List<string>(m_pollHandlers.Keys);
}
// Note that the agent string is provided simply to differentiate // Note that the agent string is provided simply to differentiate
// the handlers - it is NOT required to be an actual agent header // the handlers - it is NOT required to be an actual agent header
// value. // value.
@ -232,6 +254,11 @@ namespace OpenSim.Framework.Servers.HttpServer
return false; return false;
} }
public List<string> GetAgentHandlerKeys()
{
return new List<string>(m_agentHandlers.Keys);
}
public bool AddLLSDHandler(string path, LLSDMethod handler) public bool AddLLSDHandler(string path, LLSDMethod handler)
{ {
lock (m_llsdHandlers) lock (m_llsdHandlers)
@ -245,6 +272,11 @@ namespace OpenSim.Framework.Servers.HttpServer
return false; return false;
} }
public List<string> GetLLSDHandlerKeys()
{
return new List<string>(m_llsdHandlers.Keys);
}
public bool SetDefaultLLSDHandler(DefaultLLSDMethod handler) public bool SetDefaultLLSDHandler(DefaultLLSDMethod handler)
{ {
m_defaultLlsdHandler = handler; m_defaultLlsdHandler = handler;

View File

@ -294,6 +294,14 @@ namespace OpenSim
"show connections", "show connections",
"Show connection data", HandleShow); "Show connection data", HandleShow);
m_console.Commands.AddCommand("region", false, "show circuits",
"show circuits",
"Show agent circuit data", HandleShow);
m_console.Commands.AddCommand("region", false, "show http-handlers",
"show http-handlers",
"Show all registered http handlers", HandleShow);
m_console.Commands.AddCommand("region", false, "show modules", m_console.Commands.AddCommand("region", false, "show modules",
"show modules", "show modules",
"Show module data", HandleShow); "Show module data", HandleShow);
@ -943,6 +951,48 @@ namespace OpenSim
MainConsole.Instance.Output(connections.ToString()); MainConsole.Instance.Output(connections.ToString());
break; break;
case "circuits":
System.Text.StringBuilder acd = new System.Text.StringBuilder("Agent Circuits:\n");
m_sceneManager.ForEachScene(
delegate(Scene scene)
{
//this.HttpServer.
acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName);
foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.AgentCircuits.Values)
acd.AppendFormat("\t{0} {1} ({2})\n", aCircuit.firstname, aCircuit.lastname, (aCircuit.child ? "Child" : "Root"));
}
);
MainConsole.Instance.Output(acd.ToString());
break;
case "http-handlers":
System.Text.StringBuilder handlers = new System.Text.StringBuilder("Registered HTTP Handlers:\n");
handlers.AppendFormat("* XMLRPC:\n");
foreach (String s in HttpServer.GetXmlRpcHandlerKeys())
handlers.AppendFormat("\t{0}\n", s);
handlers.AppendFormat("* HTTP:\n");
List<String> poll = HttpServer.GetPollServiceHandlerKeys();
foreach (String s in HttpServer.GetHTTPHandlerKeys())
handlers.AppendFormat("\t{0} {1}\n", s, (poll.Contains(s) ? "(poll service)" : string.Empty));
handlers.AppendFormat("* Agent:\n");
foreach (String s in HttpServer.GetAgentHandlerKeys())
handlers.AppendFormat("\t{0}\n", s);
handlers.AppendFormat("* LLSD:\n");
foreach (String s in HttpServer.GetLLSDHandlerKeys())
handlers.AppendFormat("\t{0}\n", s);
handlers.AppendFormat("* StreamHandlers ({0}):\n", HttpServer.GetStreamHandlerKeys().Count);
foreach (String s in HttpServer.GetStreamHandlerKeys())
handlers.AppendFormat("\t{0}\n", s);
MainConsole.Instance.Output(handlers.ToString());
break;
case "modules": case "modules":
MainConsole.Instance.Output("The currently loaded shared modules are:"); MainConsole.Instance.Output("The currently loaded shared modules are:");
foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules) foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules)