From 7356860b487febd12c2e0de2f009a6df9ea0aeec Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 13 Jan 2010 09:17:30 -0800 Subject: Several more buglets removed. --- .../Handlers/Presence/PresenceServerPostHandler.cs | 10 ++++--- .../Server/Handlers/Simulation/AgentHandlers.cs | 12 ++++---- .../Server/Handlers/Simulation/ObjectHandlers.cs | 35 ++++++++++++++-------- .../UserAccounts/UserAccountServerPostHandler.cs | 11 +++---- 4 files changed, 40 insertions(+), 28 deletions(-) (limited to 'OpenSim/Server/Handlers') diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs index 926c195..d180bbb 100644 --- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs @@ -65,7 +65,7 @@ namespace OpenSim.Server.Handlers.Presence body = body.Trim(); //m_log.DebugFormat("[XXX]: query String: {0}", body); - + string method = string.Empty; try { Dictionary request = @@ -74,7 +74,7 @@ namespace OpenSim.Server.Handlers.Presence if (!request.ContainsKey("METHOD")) return FailureResult(); - string method = request["METHOD"].ToString(); + method = request["METHOD"].ToString(); switch (method) { @@ -97,7 +97,7 @@ namespace OpenSim.Server.Handlers.Presence } catch (Exception e) { - m_log.Debug("[PRESENCE HANDLER]: Exception {0}" + e); + m_log.DebugFormat("[PRESENCE HANDLER]: Exception in method {0}: {1}", method, e); } return FailureResult(); @@ -188,9 +188,11 @@ namespace OpenSim.Server.Handlers.Presence if (request.ContainsKey("lookAt")) Vector3.TryParse(request["lookAt"].ToString(), out look); - + if (m_PresenceService.ReportAgent(session, region, position, look)) + { return SuccessResult(); + } return FailureResult(); } diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 782034b..da9c015 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -61,11 +61,11 @@ namespace OpenSim.Server.Handlers.Simulation { //m_log.Debug("[CONNECTION DEBUGGING]: AgentHandler Called"); - m_log.Debug("---------------------------"); - m_log.Debug(" >> uri=" + request["uri"]); - m_log.Debug(" >> content-type=" + request["content-type"]); - m_log.Debug(" >> http-method=" + request["http-method"]); - m_log.Debug("---------------------------\n"); + //m_log.Debug("---------------------------"); + //m_log.Debug(" >> uri=" + request["uri"]); + //m_log.Debug(" >> content-type=" + request["content-type"]); + //m_log.Debug(" >> http-method=" + request["http-method"]); + //m_log.Debug("---------------------------\n"); Hashtable responsedata = new Hashtable(); responsedata["content_type"] = "text/html"; @@ -320,7 +320,7 @@ namespace OpenSim.Server.Handlers.Simulation responsedata["int_response_code"] = HttpStatusCode.OK; responsedata["str_response_string"] = "OpenSim agent " + id.ToString(); - m_log.Debug("[AGENT HANDLER]: Agent Deleted."); + m_log.Debug("[AGENT HANDLER]: Agent Released/Deleted."); } } diff --git a/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs b/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs index 995a3c4..b6eabe3 100644 --- a/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs @@ -59,13 +59,13 @@ namespace OpenSim.Server.Handlers.Simulation public Hashtable Handler(Hashtable request) { - m_log.Debug("[CONNECTION DEBUGGING]: ObjectHandler Called"); + //m_log.Debug("[CONNECTION DEBUGGING]: ObjectHandler Called"); - m_log.Debug("---------------------------"); - m_log.Debug(" >> uri=" + request["uri"]); - m_log.Debug(" >> content-type=" + request["content-type"]); - m_log.Debug(" >> http-method=" + request["http-method"]); - m_log.Debug("---------------------------\n"); + //m_log.Debug("---------------------------"); + //m_log.Debug(" >> uri=" + request["uri"]); + //m_log.Debug(" >> content-type=" + request["content-type"]); + //m_log.Debug(" >> http-method=" + request["http-method"]); + //m_log.Debug("---------------------------\n"); Hashtable responsedata = new Hashtable(); responsedata["content_type"] = "text/html"; @@ -75,7 +75,7 @@ namespace OpenSim.Server.Handlers.Simulation string action; if (!Utils.GetParams((string)request["uri"], out objectID, out regionID, out action)) { - m_log.InfoFormat("[REST COMMS]: Invalid parameters for object message {0}", request["uri"]); + m_log.InfoFormat("[OBJECT HANDLER]: Invalid parameters for object message {0}", request["uri"]); responsedata["int_response_code"] = 404; responsedata["str_response_string"] = "false"; @@ -101,7 +101,7 @@ namespace OpenSim.Server.Handlers.Simulation //} else { - m_log.InfoFormat("[REST COMMS]: method {0} not supported in object message", method); + m_log.InfoFormat("[OBJECT HANDLER]: method {0} not supported in object message", method); responsedata["int_response_code"] = HttpStatusCode.MethodNotAllowed; responsedata["str_response_string"] = "Mthod not allowed"; @@ -148,13 +148,13 @@ namespace OpenSim.Server.Handlers.Simulation ISceneObject sog = null; try { - //sog = SceneObjectSerializer.FromXml2Format(sogXmlStr); + //m_log.DebugFormat("[OBJECT HANDLER]: received {0}", sogXmlStr); sog = s.DeserializeObject(sogXmlStr); sog.ExtraFromXmlString(extraStr); } catch (Exception ex) { - m_log.InfoFormat("[REST COMMS]: exception on deserializing scene object {0}", ex.Message); + m_log.InfoFormat("[OBJECT HANDLER]: exception on deserializing scene object {0}", ex.Message); responsedata["int_response_code"] = HttpStatusCode.BadRequest; responsedata["str_response_string"] = "Bad request"; return; @@ -171,13 +171,22 @@ namespace OpenSim.Server.Handlers.Simulation } catch (Exception ex) { - m_log.InfoFormat("[REST COMMS]: exception on setting state for scene object {0}", ex.Message); + m_log.InfoFormat("[OBJECT HANDLER]: exception on setting state for scene object {0}", ex.Message); // ignore and continue } } } - // This is the meaning of POST object - bool result = m_SimulationService.CreateObject(destination, sog, false); + + bool result = false; + try + { + // This is the meaning of POST object + result = m_SimulationService.CreateObject(destination, sog, false); + } + catch (Exception e) + { + m_log.DebugFormat("[OBJECT HANDLER]: Exception in CreateObject: {0}", e.StackTrace); + } responsedata["int_response_code"] = HttpStatusCode.OK; responsedata["str_response_string"] = result.ToString(); diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs index b54b63e..6a82165 100644 --- a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs +++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs @@ -68,7 +68,7 @@ namespace OpenSim.Server.Handlers.UserAccounts //httpRequest.Headers["authorization"] ... //m_log.DebugFormat("[XXX]: query String: {0}", body); - + string method = string.Empty; try { Dictionary request = @@ -77,7 +77,7 @@ namespace OpenSim.Server.Handlers.UserAccounts if (!request.ContainsKey("METHOD")) return FailureResult(); - string method = request["METHOD"].ToString(); + method = request["METHOD"].ToString(); switch (method) { @@ -88,11 +88,11 @@ namespace OpenSim.Server.Handlers.UserAccounts case "setaccount": return StoreAccount(request); } - m_log.DebugFormat("[PRESENCE HANDLER]: unknown method request: {0}", method); + m_log.DebugFormat("[USER SERVICE HANDLER]: unknown method request: {0}", method); } catch (Exception e) { - m_log.Debug("[PRESENCE HANDLER]: Exception {0}" + e); + m_log.DebugFormat("[USER SERVICE HANDLER]: Exception in method {0}: {1}", method, e); } return FailureResult(); @@ -134,7 +134,9 @@ namespace OpenSim.Server.Handlers.UserAccounts if (account == null) result["result"] = "null"; else + { result["result"] = account.ToKeyValuePairs(); + } return ResultToBytes(result); } @@ -247,7 +249,6 @@ namespace OpenSim.Server.Handlers.UserAccounts private byte[] ResultToBytes(Dictionary result) { string xmlString = ServerUtils.BuildXmlResponse(result); - //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); UTF8Encoding encoding = new UTF8Encoding(); return encoding.GetBytes(xmlString); } -- cgit v1.1