Changed the way HG client verification is done: now transforming local and LAN client IPs into external IPs. This addresses some issues related to running both the user agents service and the viewer in the same machine/LAN, which then presents a problem when the user agent goes to an external network.

This commit is contained in:
Diva Canto
2010-07-30 14:04:13 -07:00
parent b83910f12a
commit 8ab7d80b09
4 changed files with 84 additions and 9 deletions

View File

@@ -63,6 +63,8 @@ namespace OpenSim.Services.HypergridService
protected static IGridService m_GridService;
protected static GatekeeperServiceConnector m_GatekeeperConnector;
protected static bool m_BypassClientVerification;
public UserAgentService(IConfigSource config)
{
if (!m_Initialized)
@@ -76,6 +78,8 @@ namespace OpenSim.Services.HypergridService
string gridService = serverConfig.GetString("GridService", String.Empty);
string gridUserService = serverConfig.GetString("GridUserService", String.Empty);
m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false);
if (gridService == string.Empty || gridUserService == string.Empty)
throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function."));
@@ -212,11 +216,10 @@ namespace OpenSim.Services.HypergridService
public bool VerifyClient(UUID sessionID, string token)
{
m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token);
//return true;
if (m_BypassClientVerification)
return true;
// Commenting this for now until I understand better what part of a sender's
// info stays unchanged throughout a session
m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token);
if (m_TravelingAgents.ContainsKey(sessionID))
return m_TravelingAgents[sessionID].ClientToken == token;