From 796216e44ff78b1088f9a977b810f16d98855f37 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 7 Dec 2010 20:05:53 -0800 Subject: Added an exception handler on CreateObject handler, just in case there's an exception being thrown that is silently being ignored by the http server. (Trying to catch Melanie's problem with attachments on TPs) --- .../Server/Handlers/Simulation/ObjectHandlers.cs | 51 +++++++++++++--------- 1 file changed, 31 insertions(+), 20 deletions(-) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs b/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs index 04ff83f..984b843 100644 --- a/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs @@ -84,32 +84,43 @@ namespace OpenSim.Server.Handlers.Simulation return responsedata; } - // Next, let's parse the verb - string method = (string)request["http-method"]; - if (method.Equals("POST")) - { - DoObjectPost(request, responsedata, regionID); - return responsedata; - } - else if (method.Equals("PUT")) + try { - DoObjectPut(request, responsedata, regionID); - return responsedata; + // Next, let's parse the verb + string method = (string)request["http-method"]; + if (method.Equals("POST")) + { + DoObjectPost(request, responsedata, regionID); + return responsedata; + } + else if (method.Equals("PUT")) + { + DoObjectPut(request, responsedata, regionID); + return responsedata; + } + //else if (method.Equals("DELETE")) + //{ + // DoObjectDelete(request, responsedata, agentID, action, regionHandle); + // return responsedata; + //} + else + { + m_log.InfoFormat("[OBJECT HANDLER]: method {0} not supported in object message", method); + responsedata["int_response_code"] = HttpStatusCode.MethodNotAllowed; + responsedata["str_response_string"] = "Method not allowed"; + + return responsedata; + } } - //else if (method.Equals("DELETE")) - //{ - // DoObjectDelete(request, responsedata, agentID, action, regionHandle); - // return responsedata; - //} - else + catch (Exception e) { - 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"; + m_log.WarnFormat("[OBJECT HANDLER]: Caught exception {0}", e.StackTrace); + responsedata["int_response_code"] = HttpStatusCode.InternalServerError; + responsedata["str_response_string"] = "Internal server error"; return responsedata; - } + } } protected void DoObjectPost(Hashtable request, Hashtable responsedata, UUID regionID) -- cgit v1.1 From 4df1d25d23d76ee3ae8c7da155462b57735f6418 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 9 Dec 2010 01:55:32 +0000 Subject: Plumb a code path for the entity transfer module to ask a destination scene whether or not an agent is allowed there as a root agent. --- .../Server/Handlers/Simulation/AgentHandlers.cs | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 1f7e502..24ae81f 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -110,6 +110,11 @@ namespace OpenSim.Server.Handlers.Simulation DoAgentDelete(request, responsedata, agentID, action, regionID); return responsedata; } + else if (method.Equals("QUERYACCESSS")) + { + DoQueryAccess(request, responsedata, agentID, regionID); + return responsedata; + } else { m_log.InfoFormat("[AGENT HANDLER]: method {0} not supported in agent message", method); @@ -300,6 +305,27 @@ namespace OpenSim.Server.Handlers.Simulation return m_SimulationService.UpdateAgent(destination, agent); } + protected virtual void DoQueryAccess(Hashtable request, Hashtable responsedata, UUID id, UUID regionID) + { + if (m_SimulationService == null) + { + m_log.Debug("[AGENT HANDLER]: Agent QUERY called. Harmless but useless."); + responsedata["content_type"] = "application/json"; + responsedata["int_response_code"] = HttpStatusCode.NotImplemented; + responsedata["str_response_string"] = string.Empty; + + return; + } + + GridRegion destination = new GridRegion(); + destination.RegionID = regionID; + + bool result = m_SimulationService.QueryAccess(destination, id); + + responsedata["int_response_code"] = HttpStatusCode.OK; + responsedata["str_response_string"] = result.ToString(); + } + protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID) { if (m_SimulationService == null) -- cgit v1.1