diff options
author | Melanie | 2010-08-21 00:32:26 +0100 |
---|---|---|
committer | Melanie | 2010-08-21 00:32:26 +0100 |
commit | f8ff98577ef3e576326c6eea28cb12ebb4e0bdc4 (patch) | |
tree | 3ef10e646ddda95929142eb2c3774b42d0923b3b /OpenSim/Server/Handlers | |
parent | Forward-port a small improvement to the land out connector (diff) | |
parent | Forward-port a small improvement to the land out connector (diff) | |
download | opensim-SC-f8ff98577ef3e576326c6eea28cb12ebb4e0bdc4.zip opensim-SC-f8ff98577ef3e576326c6eea28cb12ebb4e0bdc4.tar.gz opensim-SC-f8ff98577ef3e576326c6eea28cb12ebb4e0bdc4.tar.bz2 opensim-SC-f8ff98577ef3e576326c6eea28cb12ebb4e0bdc4.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 9739e5a..05b00e5 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -183,6 +183,8 @@ namespace OpenSim.Server.Handlers.Simulation | |||
183 | 183 | ||
184 | resp["reason"] = OSD.FromString(reason); | 184 | resp["reason"] = OSD.FromString(reason); |
185 | resp["success"] = OSD.FromBoolean(result); | 185 | resp["success"] = OSD.FromBoolean(result); |
186 | // Let's also send out the IP address of the caller back to the caller (HG 1.5) | ||
187 | resp["your_ip"] = OSD.FromString(GetCallerIP(request)); | ||
186 | 188 | ||
187 | // TODO: add reason if not String.Empty? | 189 | // TODO: add reason if not String.Empty? |
188 | responsedata["int_response_code"] = HttpStatusCode.OK; | 190 | responsedata["int_response_code"] = HttpStatusCode.OK; |
@@ -375,6 +377,24 @@ namespace OpenSim.Server.Handlers.Simulation | |||
375 | { | 377 | { |
376 | m_SimulationService.ReleaseAgent(regionID, id, ""); | 378 | m_SimulationService.ReleaseAgent(regionID, id, ""); |
377 | } | 379 | } |
380 | |||
381 | private string GetCallerIP(Hashtable req) | ||
382 | { | ||
383 | if (req.ContainsKey("headers")) | ||
384 | { | ||
385 | try | ||
386 | { | ||
387 | Hashtable headers = (Hashtable)req["headers"]; | ||
388 | if (headers.ContainsKey("remote_addr") && headers["remote_addr"] != null) | ||
389 | return headers["remote_addr"].ToString(); | ||
390 | } | ||
391 | catch (Exception e) | ||
392 | { | ||
393 | m_log.WarnFormat("[AGENT HANDLER]: exception in GetCallerIP: {0}", e.Message); | ||
394 | } | ||
395 | } | ||
396 | return string.Empty; | ||
397 | } | ||
378 | } | 398 | } |
379 | 399 | ||
380 | } | 400 | } |