Deleted GET agent all around. Not used.

cpu-performance
Diva Canto 2013-07-13 17:56:42 -07:00
parent 4d93870fe5
commit 931eb892d9
5 changed files with 2 additions and 134 deletions

View File

@ -250,26 +250,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return true; return true;
} }
public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent)
{
agent = null;
if (destination == null)
return false;
if (m_scenes.ContainsKey(destination.RegionID))
{
// m_log.DebugFormat(
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
// s.RegionInfo.RegionName, destination.RegionHandle);
return m_scenes[destination.RegionID].IncomingRetrieveRootAgent(id, out agent);
}
//m_log.Debug("[LOCAL COMMS]: region not found for ChildAgentUpdate");
return false;
}
public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason)
{ {
reason = "Communications failure"; reason = "Communications failure";

View File

@ -212,24 +212,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return m_remoteConnector.UpdateAgent(destination, cAgentData); return m_remoteConnector.UpdateAgent(destination, cAgentData);
} }
public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent)
{
agent = null;
if (destination == null)
return false;
// Try local first
if (m_localBackend.RetrieveAgent(destination, id, out agent))
return true;
// else do the remote thing
if (!m_localBackend.IsLocalRegion(destination.RegionID))
return m_remoteConnector.RetrieveAgent(destination, id, out agent);
return false;
}
public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason)
{ {
reason = "Communications failure"; reason = "Communications failure";

View File

@ -90,12 +90,7 @@ namespace OpenSim.Server.Handlers.Simulation
// Next, let's parse the verb // Next, let's parse the verb
string method = (string)request["http-method"]; string method = (string)request["http-method"];
if (method.Equals("GET")) if (method.Equals("DELETE"))
{
DoAgentGet(request, responsedata, agentID, regionID);
return responsedata;
}
else if (method.Equals("DELETE"))
{ {
DoAgentDelete(request, responsedata, agentID, action, regionID); DoAgentDelete(request, responsedata, agentID, action, regionID);
return responsedata; return responsedata;
@ -107,7 +102,7 @@ namespace OpenSim.Server.Handlers.Simulation
} }
else else
{ {
m_log.InfoFormat("[AGENT HANDLER]: method {0} not supported in agent message (caller is {1})", method, Util.GetCallerIP(request)); m_log.ErrorFormat("[AGENT HANDLER]: method {0} not supported in agent message {1} (caller is {2})", method, (string)request["uri"], Util.GetCallerIP(request));
responsedata["int_response_code"] = HttpStatusCode.MethodNotAllowed; responsedata["int_response_code"] = HttpStatusCode.MethodNotAllowed;
responsedata["str_response_string"] = "Method not allowed"; responsedata["str_response_string"] = "Method not allowed";
@ -156,58 +151,6 @@ namespace OpenSim.Server.Handlers.Simulation
// Console.WriteLine("str_response_string [{0}]", responsedata["str_response_string"]); // Console.WriteLine("str_response_string [{0}]", responsedata["str_response_string"]);
} }
protected virtual void DoAgentGet(Hashtable request, Hashtable responsedata, UUID id, UUID regionID)
{
if (m_SimulationService == null)
{
m_log.Debug("[AGENT HANDLER]: Agent GET 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;
IAgentData agent = null;
bool result = m_SimulationService.RetrieveAgent(destination, id, out agent);
OSDMap map = null;
if (result)
{
if (agent != null) // just to make sure
{
map = agent.Pack();
string strBuffer = "";
try
{
strBuffer = OSDParser.SerializeJsonString(map);
}
catch (Exception e)
{
m_log.WarnFormat("[AGENT HANDLER]: Exception thrown on serialization of DoAgentGet: {0}", e.Message);
responsedata["int_response_code"] = HttpStatusCode.InternalServerError;
// ignore. buffer will be empty, caller should check.
}
responsedata["content_type"] = "application/json";
responsedata["int_response_code"] = HttpStatusCode.OK;
responsedata["str_response_string"] = strBuffer;
}
else
{
responsedata["int_response_code"] = HttpStatusCode.InternalServerError;
responsedata["str_response_string"] = "Internal error";
}
}
else
{
responsedata["int_response_code"] = HttpStatusCode.NotFound;
responsedata["str_response_string"] = "Not Found";
}
}
protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID) protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID)
{ {
m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID); m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID);

View File

@ -271,41 +271,6 @@ namespace OpenSim.Services.Connectors.Simulation
return false; return false;
} }
/// <summary>
/// Not sure what sequence causes this function to be invoked. The only calling
/// path is through the GET method
/// </summary>
public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent)
{
// m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: RetrieveAgent start");
agent = null;
// Eventually, we want to use a caps url instead of the agentID
string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
try
{
OSDMap result = WebUtil.GetFromService(uri, 10000);
if (result["Success"].AsBoolean())
{
// OSDMap args = Util.GetOSDMap(result["_RawResult"].AsString());
OSDMap args = (OSDMap)result["_Result"];
if (args != null)
{
agent = new CompleteAgentData();
agent.Unpack(args, null);
return true;
}
}
}
catch (Exception e)
{
m_log.Warn("[REMOTE SIMULATION CONNECTOR]: UpdateAgent failed with exception: " + e.ToString());
}
return false;
}
/// <summary> /// <summary>
/// </summary> /// </summary>

View File

@ -75,8 +75,6 @@ namespace OpenSim.Services.Interfaces
/// <returns></returns> /// <returns></returns>
bool UpdateAgent(GridRegion destination, AgentPosition data); bool UpdateAgent(GridRegion destination, AgentPosition data);
bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent);
bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason); bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason);
/// <summary> /// <summary>