Improved debug messages to track what is going on with the XFF header
parent
0fabe0e5a5
commit
e80bcc0049
|
@ -217,6 +217,8 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
||||||
Hashtable headers = (Hashtable)request["headers"];
|
Hashtable headers = (Hashtable)request["headers"];
|
||||||
if (headers.ContainsKey("X-Forwarded-For") && headers["X-Forwarded-For"] != null)
|
if (headers.ContainsKey("X-Forwarded-For") && headers["X-Forwarded-For"] != null)
|
||||||
{
|
{
|
||||||
|
m_log.DebugFormat("[HOME AGENT HANDLER]: XFF is {0}", headers["X-Forwarded-For"]);
|
||||||
|
|
||||||
IPEndPoint ep = Util.GetClientIPFromXFF((string)headers["X-Forwarded-For"]);
|
IPEndPoint ep = Util.GetClientIPFromXFF((string)headers["X-Forwarded-For"]);
|
||||||
if (ep != null)
|
if (ep != null)
|
||||||
return ep.Address.ToString();
|
return ep.Address.ToString();
|
||||||
|
|
|
@ -202,6 +202,8 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||||
Hashtable headers = (Hashtable)request["headers"];
|
Hashtable headers = (Hashtable)request["headers"];
|
||||||
if (headers.ContainsKey("X-Forwarded-For") && headers["X-Forwarded-For"] != null)
|
if (headers.ContainsKey("X-Forwarded-For") && headers["X-Forwarded-For"] != null)
|
||||||
{
|
{
|
||||||
|
m_log.DebugFormat("[AGENT HANDLER]: XFF is {0}", headers["X-Forwarded-For"]);
|
||||||
|
|
||||||
IPEndPoint ep = Util.GetClientIPFromXFF((string)headers["X-Forwarded-For"]);
|
IPEndPoint ep = Util.GetClientIPFromXFF((string)headers["X-Forwarded-For"]);
|
||||||
if (ep != null)
|
if (ep != null)
|
||||||
return ep.Address.ToString();
|
return ep.Address.ToString();
|
||||||
|
|
|
@ -155,7 +155,7 @@ namespace OpenSim.Services.HypergridService
|
||||||
string myExternalIP = string.Empty;
|
string myExternalIP = string.Empty;
|
||||||
string gridName = gatekeeper.ServerURI;
|
string gridName = gatekeeper.ServerURI;
|
||||||
|
|
||||||
m_log.DebugFormat("[USER AGENT SERVICE]: m_grid - {0}, gn - {1}", m_GridName, gridName);
|
m_log.DebugFormat("[USER AGENT SERVICE]: this grid: {0}, desired grid: {1}", m_GridName, gridName);
|
||||||
|
|
||||||
if (m_GridName == gridName)
|
if (m_GridName == gridName)
|
||||||
success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason);
|
success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason);
|
||||||
|
@ -266,11 +266,13 @@ namespace OpenSim.Services.HypergridService
|
||||||
|
|
||||||
if (m_TravelingAgents.ContainsKey(sessionID))
|
if (m_TravelingAgents.ContainsKey(sessionID))
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[USER AGENT SERVICE]: Comparing with login IP {0} and MyIP {1}",
|
bool result = m_TravelingAgents[sessionID].ClientIPAddress == reportedIP ||
|
||||||
m_TravelingAgents[sessionID].ClientIPAddress, m_TravelingAgents[sessionID].MyIpAddress);
|
|
||||||
|
|
||||||
return m_TravelingAgents[sessionID].ClientIPAddress == reportedIP ||
|
|
||||||
m_TravelingAgents[sessionID].MyIpAddress == reportedIP; // NATed
|
m_TravelingAgents[sessionID].MyIpAddress == reportedIP; // NATed
|
||||||
|
|
||||||
|
m_log.DebugFormat("[USER AGENT SERVICE]: Comparing {0} with login IP {1} and MyIP {1}; result is {3}",
|
||||||
|
reportedIP, m_TravelingAgents[sessionID].ClientIPAddress, m_TravelingAgents[sessionID].MyIpAddress, result);
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue