aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Simulation
diff options
context:
space:
mode:
authorMelanie2011-01-18 01:28:50 +0000
committerMelanie2011-01-18 01:28:50 +0000
commit6306578fcf812bfdb27cb00b6c3fc2886e247b87 (patch)
tree19f379c3507a1714af5d7bb223dda1f6b0a8dddb /OpenSim/Server/Handlers/Simulation
parentMerge branch 'master' into careminster-presence-refactor (diff)
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC-6306578fcf812bfdb27cb00b6c3fc2886e247b87.zip
opensim-SC-6306578fcf812bfdb27cb00b6c3fc2886e247b87.tar.gz
opensim-SC-6306578fcf812bfdb27cb00b6c3fc2886e247b87.tar.bz2
opensim-SC-6306578fcf812bfdb27cb00b6c3fc2886e247b87.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Server/Handlers/Simulation')
-rw-r--r--OpenSim/Server/Handlers/Simulation/AgentHandlers.cs17
1 files changed, 13 insertions, 4 deletions
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 8aa410b..6d01f80 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -205,13 +205,22 @@ namespace OpenSim.Server.Handlers.Simulation
205 205
206 // We're behind a proxy 206 // We're behind a proxy
207 Hashtable headers = (Hashtable)request["headers"]; 207 Hashtable headers = (Hashtable)request["headers"];
208 if (headers.ContainsKey("X-Forwarded-For") && headers["X-Forwarded-For"] != null) 208 string xff = "X-Forwarded-For";
209 if (headers.ContainsKey(xff.ToLower()))
210 xff = xff.ToLower();
211
212 if (!headers.ContainsKey(xff) || headers[xff] == null)
209 { 213 {
210 IPEndPoint ep = Util.GetClientIPFromXFF((string)headers["X-Forwarded-For"]); 214 m_log.WarnFormat("[AGENT HANDLER]: No XFF header");
211 if (ep != null) 215 return Util.GetCallerIP(request);
212 return ep.Address.ToString();
213 } 216 }
214 217
218 m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers[xff]);
219
220 IPEndPoint ep = Util.GetClientIPFromXFF((string)headers[xff]);
221 if (ep != null)
222 return ep.Address.ToString();
223
215 // Oops 224 // Oops
216 return Util.GetCallerIP(request); 225 return Util.GetCallerIP(request);
217 } 226 }