diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 9064464239..35a0be41de 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -82,6 +82,11 @@ namespace OpenSim.Framework.Servers.HttpServer /// /// Control the printing of certain debug messages. /// + /// + /// If DebugLevel >= 1, then short warnings are logged when receiving bad input data. + /// If DebugLevel >= 2, then long warnings are logged when receiving bad input data. + /// If DebugLevel >= 3, then short notices about all incoming non-poll HTTP requests are logged. + /// public int DebugLevel { get; set; } public uint SSLPort @@ -450,7 +455,7 @@ namespace OpenSim.Framework.Servers.HttpServer if (TryGetStreamHandler(handlerKey, out requestHandler)) { - if (DebugLevel >= 1) + if (DebugLevel >= 3) m_log.DebugFormat( "[BASE HTTP SERVER]: Found stream handler for {0} {1} {2} {3}", request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description); @@ -531,7 +536,7 @@ namespace OpenSim.Framework.Servers.HttpServer case null: case "text/html": - if (DebugLevel >= 1) + if (DebugLevel >= 3) m_log.DebugFormat( "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}", request.ContentType, request.HttpMethod, request.Url.PathAndQuery); @@ -543,7 +548,7 @@ namespace OpenSim.Framework.Servers.HttpServer case "application/xml+llsd": case "application/llsd+json": - if (DebugLevel >= 1) + if (DebugLevel >= 3) m_log.DebugFormat( "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}", request.ContentType, request.HttpMethod, request.Url.PathAndQuery); @@ -564,7 +569,7 @@ namespace OpenSim.Framework.Servers.HttpServer //m_log.Info("[Debug BASE HTTP SERVER]: Checking for LLSD Handler"); if (DoWeHaveALLSDHandler(request.RawUrl)) { - if (DebugLevel >= 1) + if (DebugLevel >= 3) m_log.DebugFormat( "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}", request.ContentType, request.HttpMethod, request.Url.PathAndQuery); @@ -574,7 +579,7 @@ namespace OpenSim.Framework.Servers.HttpServer // m_log.DebugFormat("[BASE HTTP SERVER]: Checking for HTTP Handler for request {0}", request.RawUrl); else if (DoWeHaveAHTTPHandler(request.RawUrl)) { - if (DebugLevel >= 1) + if (DebugLevel >= 3) m_log.DebugFormat( "[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}", request.ContentType, request.HttpMethod, request.Url.PathAndQuery); @@ -583,8 +588,7 @@ namespace OpenSim.Framework.Servers.HttpServer } else { - - if (DebugLevel >= 1) + if (DebugLevel >= 3) m_log.DebugFormat( "[BASE HTTP SERVER]: Assuming a generic XMLRPC request for {0} {1}", request.HttpMethod, request.Url.PathAndQuery); @@ -793,8 +797,23 @@ namespace OpenSim.Framework.Servers.HttpServer { xmlRprcRequest = (XmlRpcRequest) (new XmlRpcRequestDeserializer()).Deserialize(requestBody); } - catch (XmlException) + catch (XmlException e) { + if (DebugLevel >= 1) + { + if (DebugLevel >= 2) + m_log.Warn( + string.Format( + "[BASE HTTP SERVER]: Got XMLRPC request with invalid XML from {0}. XML was '{1}'. Sending blank response. Exception ", + request.RemoteIPEndPoint, requestBody), + e); + else + { + m_log.WarnFormat( + "[BASE HTTP SERVER]: Got XMLRPC request with invalid XML from {0}, length {1}. Sending blank response.", + request.RemoteIPEndPoint, requestBody.Length); + } + } } if (xmlRprcRequest != null) diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 99110de95f..07eeba8b9c 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -245,10 +245,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);