From 754bfeeb0465201f3a2968214ba0bd66bf44e1bc Mon Sep 17 00:00:00 2001 From: justincc Date: Sat, 19 Dec 2009 16:58:30 +0000 Subject: [PATCH] Add log warning if xmlrpc request deserialization fails --- .../Servers/HttpServer/BaseHttpServer.cs | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 8eeb0679ac..c469010ac3 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -40,7 +40,7 @@ using HttpServer; using log4net; using Nwc.XmlRpc; using OpenMetaverse.StructuredData; -using CoolHTTPListener = HttpServer.HttpListener; +using CoolHTTPListener = HttpServer.HttpListener; using CoolHttpServer = HttpServer; using HttpListener=System.Net.HttpListener; @@ -700,10 +700,13 @@ namespace OpenSim.Framework.Servers.HttpServer try { - xmlRprcRequest = (XmlRpcRequest) (new XmlRpcRequestDeserializer()).Deserialize(requestBody); + xmlRprcRequest = (XmlRpcRequest)(new XmlRpcRequestDeserializer()).Deserialize(requestBody); } - catch (XmlException) - { + catch (XmlException e) + { + m_log.WarnFormat( + "[BASE HTTP SERVER]: Ignoring XMLRPC request from {0} due to deserialization exception {1} {2}", + request.RemoteIPEndPoint, e.Message, e.StackTrace); } if (xmlRprcRequest != null) @@ -1825,19 +1828,19 @@ namespace OpenSim.Framework.Servers.HttpServer public void Write(object source, LogPrio priority, string message) { switch (priority) - { + { case CoolHttpServer.LogPrio.Debug: m_log.DebugFormat("[{0}]: {1}", source.ToString(), message); - break; + break; case CoolHttpServer.LogPrio.Error: m_log.ErrorFormat("[{0}]: {1}", source.ToString(), message); - break; + break; case CoolHttpServer.LogPrio.Info: m_log.InfoFormat("[{0}]: {1}", source.ToString(), message); - break; + break; case CoolHttpServer.LogPrio.Warning: m_log.WarnFormat("[{0}]: {1}", source.ToString(), message); - break; + break; case CoolHttpServer.LogPrio.Fatal: m_log.ErrorFormat("[{0}]: FATAL! - {1}", source.ToString(), message); break;