Merge branch 'master' into careminster-presence-refactor

This commit is contained in:
Melanie
2010-08-21 00:32:26 +01:00
24 changed files with 675 additions and 550 deletions

View File

@@ -183,6 +183,8 @@ namespace OpenSim.Server.Handlers.Simulation
resp["reason"] = OSD.FromString(reason);
resp["success"] = OSD.FromBoolean(result);
// Let's also send out the IP address of the caller back to the caller (HG 1.5)
resp["your_ip"] = OSD.FromString(GetCallerIP(request));
// TODO: add reason if not String.Empty?
responsedata["int_response_code"] = HttpStatusCode.OK;
@@ -375,6 +377,24 @@ namespace OpenSim.Server.Handlers.Simulation
{
m_SimulationService.ReleaseAgent(regionID, id, "");
}
private string GetCallerIP(Hashtable req)
{
if (req.ContainsKey("headers"))
{
try
{
Hashtable headers = (Hashtable)req["headers"];
if (headers.ContainsKey("remote_addr") && headers["remote_addr"] != null)
return headers["remote_addr"].ToString();
}
catch (Exception e)
{
m_log.WarnFormat("[AGENT HANDLER]: exception in GetCallerIP: {0}", e.Message);
}
}
return string.Empty;
}
}
}