receivers can't tell if there where proxies on path unless they look

0.9.0-post-fixes
UbitUmarov 2017-05-22 21:22:04 +01:00
parent ea88927a65
commit 4da5d249d8
2 changed files with 23 additions and 25 deletions

View File

@ -64,7 +64,7 @@ namespace OpenSim.Server.Handlers.Login
public XmlRpcResponse HandleXMLRPCLogin(XmlRpcRequest request, IPEndPoint remoteClient)
{
Hashtable requestData = (Hashtable)request.Params[0];
if (m_Proxy && request.Params[3] != null)
if (request.Params[3] != null)
{
IPEndPoint ep = Util.GetClientIPFromXFF((string)request.Params[3]);
if (ep != null)

View File

@ -517,10 +517,8 @@ namespace OpenSim.Server.Handlers.Simulation
protected string GetCallerIP(Hashtable request)
{
if (!m_Proxy)
return Util.GetCallerIP(request);
// We're behind a proxy
if (request.ContainsKey("headers"))
{
Hashtable headers = (Hashtable)request["headers"];
//// DEBUG
@ -528,7 +526,7 @@ namespace OpenSim.Server.Handlers.Simulation
// m_log.DebugFormat("XXX {0} = {1}", o.ToString(), (headers[o] == null? "null" : headers[o].ToString()));
string xff = "X-Forwarded-For";
if (headers.ContainsKey(xff.ToLower()))
if (!headers.ContainsKey(xff))
xff = xff.ToLower();
if (!headers.ContainsKey(xff) || headers[xff] == null)
@ -542,7 +540,7 @@ namespace OpenSim.Server.Handlers.Simulation
IPEndPoint ep = Util.GetClientIPFromXFF((string)headers[xff]);
if (ep != null)
return ep.Address.ToString();
}
// Oops
return Util.GetCallerIP(request);
}