diff options
author | Diva Canto | 2010-08-19 18:55:30 -0700 |
---|---|---|
committer | Diva Canto | 2010-08-19 21:27:07 -0700 |
commit | 05373de9df263dedccf500a02330e5d1469e5974 (patch) | |
tree | d03b0929a98f6b36258e4b91b521717d892b1e4b /OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |
parent | remove ancient and unused OpenSim.GridLaunch GUI code. (diff) | |
download | opensim-SC_OLD-05373de9df263dedccf500a02330e5d1469e5974.zip opensim-SC_OLD-05373de9df263dedccf500a02330e5d1469e5974.tar.gz opensim-SC_OLD-05373de9df263dedccf500a02330e5d1469e5974.tar.bz2 opensim-SC_OLD-05373de9df263dedccf500a02330e5d1469e5974.tar.xz |
Partial rewrite of client IP verification. Not completely finished yet, and untested. Committing to move to my other computer.
Diffstat (limited to 'OpenSim/Server/Handlers/Simulation/AgentHandlers.cs')
-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 d261678..392927a 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -178,6 +178,8 @@ namespace OpenSim.Server.Handlers.Simulation | |||
178 | 178 | ||
179 | resp["reason"] = OSD.FromString(reason); | 179 | resp["reason"] = OSD.FromString(reason); |
180 | resp["success"] = OSD.FromBoolean(result); | 180 | resp["success"] = OSD.FromBoolean(result); |
181 | // Let's also send out the IP address of the caller back to the caller (HG 1.5) | ||
182 | resp["your_ip"] = OSD.FromString(GetCallerIP(request)); | ||
181 | 183 | ||
182 | // TODO: add reason if not String.Empty? | 184 | // TODO: add reason if not String.Empty? |
183 | responsedata["int_response_code"] = HttpStatusCode.OK; | 185 | responsedata["int_response_code"] = HttpStatusCode.OK; |
@@ -352,6 +354,24 @@ namespace OpenSim.Server.Handlers.Simulation | |||
352 | { | 354 | { |
353 | m_SimulationService.ReleaseAgent(regionID, id, ""); | 355 | m_SimulationService.ReleaseAgent(regionID, id, ""); |
354 | } | 356 | } |
357 | |||
358 | private string GetCallerIP(Hashtable req) | ||
359 | { | ||
360 | if (req.ContainsKey("headers")) | ||
361 | { | ||
362 | try | ||
363 | { | ||
364 | Hashtable headers = (Hashtable)req["headers"]; | ||
365 | if (headers.ContainsKey("remote_addr") && headers["remote_addr"] != null) | ||
366 | return headers["remote_addr"].ToString(); | ||
367 | } | ||
368 | catch (Exception e) | ||
369 | { | ||
370 | m_log.WarnFormat("[AGENT HANDLER]: exception in GetCallerIP: {0}", e.Message); | ||
371 | } | ||
372 | } | ||
373 | return string.Empty; | ||
374 | } | ||
355 | } | 375 | } |
356 | 376 | ||
357 | } | 377 | } |