diff options
author | BlueWall | 2011-01-27 08:53:57 -0500 |
---|---|---|
committer | BlueWall | 2011-01-27 08:53:57 -0500 |
commit | d89d9d1b1310d494fbb7712057eab8a196e10a04 (patch) | |
tree | 62834b7f5954aa8f013a159ee2fc3ccee385e673 /OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |
parent | Make FireAndForgetWrapper a singleton class (diff) | |
parent | Make it work (diff) | |
download | opensim-SC_OLD-d89d9d1b1310d494fbb7712057eab8a196e10a04.zip opensim-SC_OLD-d89d9d1b1310d494fbb7712057eab8a196e10a04.tar.gz opensim-SC_OLD-d89d9d1b1310d494fbb7712057eab8a196e10a04.tar.bz2 opensim-SC_OLD-d89d9d1b1310d494fbb7712057eab8a196e10a04.tar.xz |
Merge branch 'master' of /home/opensim/src/OpenSim/Core
Diffstat (limited to 'OpenSim/Server/Handlers/Simulation/AgentHandlers.cs')
-rw-r--r-- | OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 9c41bcb..57672a8 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -200,15 +200,22 @@ namespace OpenSim.Server.Handlers.Simulation | |||
200 | 200 | ||
201 | // We're behind a proxy | 201 | // We're behind a proxy |
202 | Hashtable headers = (Hashtable)request["headers"]; | 202 | Hashtable headers = (Hashtable)request["headers"]; |
203 | if (headers.ContainsKey("X-Forwarded-For") && headers["X-Forwarded-For"] != null) | 203 | string xff = "X-Forwarded-For"; |
204 | { | 204 | if (headers.ContainsKey(xff.ToLower())) |
205 | m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers["X-Forwarded-For"]); | 205 | xff = xff.ToLower(); |
206 | 206 | ||
207 | IPEndPoint ep = Util.GetClientIPFromXFF((string)headers["X-Forwarded-For"]); | 207 | if (!headers.ContainsKey(xff) || headers[xff] == null) |
208 | if (ep != null) | 208 | { |
209 | return ep.Address.ToString(); | 209 | m_log.WarnFormat("[AGENT HANDLER]: No XFF header"); |
210 | return Util.GetCallerIP(request); | ||
210 | } | 211 | } |
211 | 212 | ||
213 | m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers[xff]); | ||
214 | |||
215 | IPEndPoint ep = Util.GetClientIPFromXFF((string)headers[xff]); | ||
216 | if (ep != null) | ||
217 | return ep.Address.ToString(); | ||
218 | |||
212 | // Oops | 219 | // Oops |
213 | return Util.GetCallerIP(request); | 220 | return Util.GetCallerIP(request); |
214 | } | 221 | } |