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)

viewer-2-initial-appearance
Diva Canto 2010-12-07 20:05:53 -08:00
parent 7cfb3d7e96
commit 796216e44f
1 changed files with 31 additions and 20 deletions

View File

@ -84,32 +84,43 @@ namespace OpenSim.Server.Handlers.Simulation
return responsedata; return responsedata;
} }
// Next, let's parse the verb try
string method = (string)request["http-method"];
if (method.Equals("POST"))
{ {
DoObjectPost(request, responsedata, regionID); // Next, let's parse the verb
return responsedata; 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("PUT")) catch (Exception e)
{ {
DoObjectPut(request, responsedata, regionID); m_log.WarnFormat("[OBJECT HANDLER]: Caught exception {0}", e.StackTrace);
return responsedata; responsedata["int_response_code"] = HttpStatusCode.InternalServerError;
} responsedata["str_response_string"] = "Internal server error";
//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"] = "Mthod not allowed";
return responsedata; return responsedata;
}
}
} }
protected void DoObjectPost(Hashtable request, Hashtable responsedata, UUID regionID) protected void DoObjectPost(Hashtable request, Hashtable responsedata, UUID regionID)