diff options
Diffstat (limited to 'OpenSim/Server/Handlers')
4 files changed, 26 insertions, 28 deletions
diff --git a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs index 072429a..4e7ab00 100644 --- a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs +++ b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs | |||
@@ -64,7 +64,7 @@ namespace OpenSim.Server.Handlers.Login | |||
64 | public XmlRpcResponse HandleXMLRPCLogin(XmlRpcRequest request, IPEndPoint remoteClient) | 64 | public XmlRpcResponse HandleXMLRPCLogin(XmlRpcRequest request, IPEndPoint remoteClient) |
65 | { | 65 | { |
66 | Hashtable requestData = (Hashtable)request.Params[0]; | 66 | Hashtable requestData = (Hashtable)request.Params[0]; |
67 | if (m_Proxy && request.Params[3] != null) | 67 | if (request.Params[3] != null) |
68 | { | 68 | { |
69 | IPEndPoint ep = Util.GetClientIPFromXFF((string)request.Params[3]); | 69 | IPEndPoint ep = Util.GetClientIPFromXFF((string)request.Params[3]); |
70 | if (ep != null) | 70 | if (ep != null) |
diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs index bfd73a2..331dabf 100644 --- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs | |||
@@ -225,8 +225,8 @@ namespace OpenSim.Server.Handlers.MapImage | |||
225 | 225 | ||
226 | private System.Net.IPAddress GetCallerIP(IOSHttpRequest request) | 226 | private System.Net.IPAddress GetCallerIP(IOSHttpRequest request) |
227 | { | 227 | { |
228 | if (!m_Proxy) | 228 | // if (!m_Proxy) |
229 | return request.RemoteIPEndPoint.Address; | 229 | // return request.RemoteIPEndPoint.Address; |
230 | 230 | ||
231 | // We're behind a proxy | 231 | // We're behind a proxy |
232 | string xff = "X-Forwarded-For"; | 232 | string xff = "X-Forwarded-For"; |
@@ -236,7 +236,7 @@ namespace OpenSim.Server.Handlers.MapImage | |||
236 | 236 | ||
237 | if (xffValue == null || (xffValue != null && xffValue == string.Empty)) | 237 | if (xffValue == null || (xffValue != null && xffValue == string.Empty)) |
238 | { | 238 | { |
239 | m_log.WarnFormat("[MAP IMAGE HANDLER]: No XFF header"); | 239 | // m_log.WarnFormat("[MAP IMAGE HANDLER]: No XFF header"); |
240 | return request.RemoteIPEndPoint.Address; | 240 | return request.RemoteIPEndPoint.Address; |
241 | } | 241 | } |
242 | 242 | ||
diff --git a/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs b/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs index 8a3875d..9daeb73 100644 --- a/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs | |||
@@ -229,8 +229,8 @@ namespace OpenSim.Server.Handlers.MapImage | |||
229 | 229 | ||
230 | private System.Net.IPAddress GetCallerIP(IOSHttpRequest request) | 230 | private System.Net.IPAddress GetCallerIP(IOSHttpRequest request) |
231 | { | 231 | { |
232 | if (!m_Proxy) | 232 | // if (!m_Proxy) |
233 | return request.RemoteIPEndPoint.Address; | 233 | // return request.RemoteIPEndPoint.Address; |
234 | 234 | ||
235 | // We're behind a proxy | 235 | // We're behind a proxy |
236 | string xff = "X-Forwarded-For"; | 236 | string xff = "X-Forwarded-For"; |
@@ -240,7 +240,7 @@ namespace OpenSim.Server.Handlers.MapImage | |||
240 | 240 | ||
241 | if (xffValue == null || (xffValue != null && xffValue == string.Empty)) | 241 | if (xffValue == null || (xffValue != null && xffValue == string.Empty)) |
242 | { | 242 | { |
243 | m_log.WarnFormat("[MAP IMAGE HANDLER]: No XFF header"); | 243 | // m_log.WarnFormat("[MAP IMAGE HANDLER]: No XFF header"); |
244 | return request.RemoteIPEndPoint.Address; | 244 | return request.RemoteIPEndPoint.Address; |
245 | } | 245 | } |
246 | 246 | ||
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index 4e1f72e..c52a1ab 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -517,32 +517,30 @@ namespace OpenSim.Server.Handlers.Simulation | |||
517 | 517 | ||
518 | protected string GetCallerIP(Hashtable request) | 518 | protected string GetCallerIP(Hashtable request) |
519 | { | 519 | { |
520 | if (!m_Proxy) | 520 | if (request.ContainsKey("headers")) |
521 | return Util.GetCallerIP(request); | 521 | { |
522 | 522 | Hashtable headers = (Hashtable)request["headers"]; | |
523 | // We're behind a proxy | ||
524 | Hashtable headers = (Hashtable)request["headers"]; | ||
525 | |||
526 | //// DEBUG | ||
527 | //foreach (object o in headers.Keys) | ||
528 | // m_log.DebugFormat("XXX {0} = {1}", o.ToString(), (headers[o] == null? "null" : headers[o].ToString())); | ||
529 | 523 | ||
530 | string xff = "X-Forwarded-For"; | 524 | //// DEBUG |
531 | if (headers.ContainsKey(xff.ToLower())) | 525 | //foreach (object o in headers.Keys) |
532 | xff = xff.ToLower(); | 526 | // m_log.DebugFormat("XXX {0} = {1}", o.ToString(), (headers[o] == null? "null" : headers[o].ToString())); |
533 | 527 | ||
534 | if (!headers.ContainsKey(xff) || headers[xff] == null) | 528 | string xff = "X-Forwarded-For"; |
535 | { | 529 | if (!headers.ContainsKey(xff)) |
536 | m_log.WarnFormat("[AGENT HANDLER]: No XFF header"); | 530 | xff = xff.ToLower(); |
537 | return Util.GetCallerIP(request); | ||
538 | } | ||
539 | 531 | ||
540 | m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers[xff]); | 532 | if (!headers.ContainsKey(xff) || headers[xff] == null) |
533 | { | ||
534 | // m_log.WarnFormat("[AGENT HANDLER]: No XFF header"); | ||
535 | return Util.GetCallerIP(request); | ||
536 | } | ||
541 | 537 | ||
542 | IPEndPoint ep = Util.GetClientIPFromXFF((string)headers[xff]); | 538 | // m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers[xff]); |
543 | if (ep != null) | ||
544 | return ep.Address.ToString(); | ||
545 | 539 | ||
540 | IPEndPoint ep = Util.GetClientIPFromXFF((string)headers[xff]); | ||
541 | if (ep != null) | ||
542 | return ep.Address.ToString(); | ||
543 | } | ||
546 | // Oops | 544 | // Oops |
547 | return Util.GetCallerIP(request); | 545 | return Util.GetCallerIP(request); |
548 | } | 546 | } |