From 9825861f4ac8d78665c33e2630824d97b356e642 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 14 Jun 2012 23:46:09 +0100 Subject: Shuffle "debug http" levels so that 1 and 2 now cause different levels of warn to be logged if we receive invalid xml for xmlrpc. --- OpenSim/Region/Application/OpenSim.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 57a3c69..96d41a4 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -250,10 +250,11 @@ namespace OpenSim m_console.Commands.AddCommand("Comms", false, "debug http", "debug http ", - "Turn on inbound http request debugging for everything except the event queue (see debug eq).", - "If level >= 2 then the handler used to service the request is logged.\n" - + "If level >= 1 then incoming HTTP requests are logged.\n" - + "If level <= 0 then no extra http logging is done.\n", + "Turn on inbound non-poll http request debugging for everything except the event queue (see debug eq).", + "If level <= 0, then no extra logging is done.\n" + + "If level >= 1, then short warnings are logged when receiving bad input data.\n" + + "If level >= 2, then long warnings are logged when receiving bad input data.\n" + + "If level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n", Debug); m_console.Commands.AddCommand("Comms", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug); -- cgit v1.1 From 93ba0332c4ccbb0c60e6d60fff71dc7d1567c9dd Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 14 Jun 2012 23:54:12 +0100 Subject: minor: Extend 'debug http' usage statement to 0..3 from 0..2 --- OpenSim/Region/Application/OpenSim.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 96d41a4..00ae880 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -927,7 +927,7 @@ namespace OpenSim } } - MainConsole.Instance.Output("Usage: debug http 0..2"); + MainConsole.Instance.Output("Usage: debug http 0..3"); break; case "scene": -- cgit v1.1 From 6993a26ba599ae38dc6f66332980657d5621987a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 15 Jun 2012 00:40:12 +0100 Subject: Get rid of some unnecessary null checks in RegionApplicationBase.StartupSpecific() - a constructor can never return null. Also adds some method doc to MainServer --- OpenSim/Region/ClientStack/RegionApplicationBase.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 6e78d6d..27a5879 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -99,17 +99,13 @@ namespace OpenSim.Region.ClientStack // "OOB" Server if (m_networkServersInfo.ssl_listener) { - BaseHttpServer server = null; - server = new BaseHttpServer( + BaseHttpServer server = new BaseHttpServer( m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path, m_networkServersInfo.cert_pass); - // Add the server to m_Servers - if(server != null) - { - m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port); - MainServer.AddHttpServer(server); - server.Start(); - } + + m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port); + MainServer.AddHttpServer(server); + server.Start(); } base.StartupSpecific(); -- cgit v1.1 From 10e87f9cdc6c2cbd01da863e01abca8f7e671f9c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 15 Jun 2012 00:59:53 +0100 Subject: Make XMLRPCModule use an existing HTTP server if one already exists on the desired port. --- OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs index 40ffcb4..0003af2 100644 --- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs @@ -131,11 +131,12 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC { // Start http server // Attach xmlrpc handlers - m_log.Info("[XML RPC MODULE]: " + - "Starting up XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands."); - BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort); +// m_log.InfoFormat( +// "[XML RPC MODULE]: Starting up XMLRPC Server on port {0} for llRemoteData commands.", +// m_remoteDataPort); + + IHttpServer httpServer = MainServer.GetHttpServer((uint)m_remoteDataPort); httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData); - httpServer.Start(); } } -- cgit v1.1 From 478acfff34b94c7c42bdb927be531b669c43af72 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 15 Jun 2012 01:24:36 +0100 Subject: When setting debug http level, do this for all known http servers, not just the main instance. --- OpenSim/Region/Application/OpenSim.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 00ae880..9043137 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -921,7 +921,7 @@ namespace OpenSim int newDebug; if (int.TryParse(args[2], out newDebug)) { - MainServer.Instance.DebugLevel = newDebug; + MainServer.DebugLevel = newDebug; MainConsole.Instance.OutputFormat("Debug http level set to {0}", newDebug); break; } -- cgit v1.1 From aeed4d3041af75cf18d140208cc4c744a73d0492 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 15 Jun 2012 01:27:29 +0100 Subject: minor: Tell user the current debug http level if "debug http" console command is executed without a level parameter --- OpenSim/Region/Application/OpenSim.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 9043137..abb30a9 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -249,12 +249,13 @@ namespace OpenSim Debug); m_console.Commands.AddCommand("Comms", false, "debug http", - "debug http ", + "debug http []", "Turn on inbound non-poll http request debugging for everything except the event queue (see debug eq).", "If level <= 0, then no extra logging is done.\n" + "If level >= 1, then short warnings are logged when receiving bad input data.\n" + "If level >= 2, then long warnings are logged when receiving bad input data.\n" - + "If level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n", + + "If level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n" + + "If no level is specified then the current level is returned.", Debug); m_console.Commands.AddCommand("Comms", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug); @@ -926,8 +927,15 @@ namespace OpenSim break; } } + else if (args.Length == 2) + { + MainConsole.Instance.OutputFormat("Current debug http level is {0}", MainServer.DebugLevel); + } + else + { + MainConsole.Instance.Output("Usage: debug http 0..3"); + } - MainConsole.Instance.Output("Usage: debug http 0..3"); break; case "scene": -- cgit v1.1 From 257b1b517dec58bf902bac63bc7ab7080286d415 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 15 Jun 2012 02:03:50 +0100 Subject: Add main instance to internal MainServer.m_Servers list to simplify internal logic. This does require the server to be added before it is set as the main Instance --- .../Linden/Caps/EventQueue/Tests/EventQueueTests.cs | 11 ++++++++++- OpenSim/Region/ClientStack/RegionApplicationBase.cs | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs index c25b58c..cd70410 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/Tests/EventQueueTests.cs @@ -51,7 +51,16 @@ namespace OpenSim.Region.ClientStack.Linden.Tests [SetUp] public void SetUp() { - MainServer.Instance = new BaseHttpServer(9999, false, 9998, ""); + uint port = 9999; + uint sslPort = 9998; + + // This is an unfortunate bit of clean up we have to do because MainServer manages things through static + // variables and the VM is not restarted between tests. + MainServer.RemoveHttpServer(port); + + BaseHttpServer server = new BaseHttpServer(port, false, sslPort, ""); + MainServer.AddHttpServer(server); + MainServer.Instance = server; IConfigSource config = new IniConfigSource(); config.AddConfig("Startup"); diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 27a5879..c4324e8 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -94,6 +94,7 @@ namespace OpenSim.Region.ClientStack m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort); m_httpServer.Start(); + MainServer.AddHttpServer(m_httpServer); MainServer.Instance = m_httpServer; // "OOB" Server -- cgit v1.1 From 94517c8d5c63f9e8a1ea9a83b04db956f27aa25d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 15 Jun 2012 02:51:52 +0100 Subject: Make the "debug http" command available for robust as well as the simulator. This allows one to see incoming requests as they happen. This required making everything use the common MainServer class for registering and retrieving http servers, rather than duplicate structures. --- OpenSim/Region/Application/OpenSim.cs | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index abb30a9..faa9e09 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -231,6 +231,8 @@ namespace OpenSim /// private void RegisterConsoleCommands() { + MainServer.RegisterHttpConsoleCommands(m_console); + m_console.Commands.AddCommand("Objects", false, "force update", "force update", "Force the update of all objects on clients", @@ -248,16 +250,6 @@ namespace OpenSim + "If an avatar name is given then only packets from that avatar are logged", Debug); - m_console.Commands.AddCommand("Comms", false, "debug http", - "debug http []", - "Turn on inbound non-poll http request debugging for everything except the event queue (see debug eq).", - "If level <= 0, then no extra logging is done.\n" - + "If level >= 1, then short warnings are logged when receiving bad input data.\n" - + "If level >= 2, then long warnings are logged when receiving bad input data.\n" - + "If level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n" - + "If no level is specified then the current level is returned.", - Debug); - m_console.Commands.AddCommand("Comms", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug); m_console.Commands.AddCommand("Regions", false, "debug scene", @@ -916,28 +908,6 @@ namespace OpenSim break; - case "http": - if (args.Length == 3) - { - int newDebug; - if (int.TryParse(args[2], out newDebug)) - { - MainServer.DebugLevel = newDebug; - MainConsole.Instance.OutputFormat("Debug http level set to {0}", newDebug); - break; - } - } - else if (args.Length == 2) - { - MainConsole.Instance.OutputFormat("Current debug http level is {0}", MainServer.DebugLevel); - } - else - { - MainConsole.Instance.Output("Usage: debug http 0..3"); - } - - break; - case "scene": if (args.Length == 4) { -- cgit v1.1