diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/HypergridService/GatekeeperService.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 004311f..7b84d55 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs | |||
@@ -68,6 +68,7 @@ namespace OpenSim.Services.HypergridService | |||
68 | private static UUID m_ScopeID; | 68 | private static UUID m_ScopeID; |
69 | private static bool m_AllowTeleportsToAnyRegion; | 69 | private static bool m_AllowTeleportsToAnyRegion; |
70 | private static string m_ExternalName; | 70 | private static string m_ExternalName; |
71 | private static Uri m_Uri; | ||
71 | private static GridRegion m_DefaultGatewayRegion; | 72 | private static GridRegion m_DefaultGatewayRegion; |
72 | 73 | ||
73 | public GatekeeperService(IConfigSource config, ISimulationService simService) | 74 | public GatekeeperService(IConfigSource config, ISimulationService simService) |
@@ -99,6 +100,15 @@ namespace OpenSim.Services.HypergridService | |||
99 | if (m_ExternalName != string.Empty && !m_ExternalName.EndsWith("/")) | 100 | if (m_ExternalName != string.Empty && !m_ExternalName.EndsWith("/")) |
100 | m_ExternalName = m_ExternalName + "/"; | 101 | m_ExternalName = m_ExternalName + "/"; |
101 | 102 | ||
103 | try | ||
104 | { | ||
105 | m_Uri = new Uri(m_ExternalName); | ||
106 | } | ||
107 | catch | ||
108 | { | ||
109 | m_log.WarnFormat("[GATEKEEPER SERVICE]: Malformed gatekeeper address {0}", m_ExternalName); | ||
110 | } | ||
111 | |||
102 | Object[] args = new Object[] { config }; | 112 | Object[] args = new Object[] { config }; |
103 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | 113 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); |
104 | m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); | 114 | m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); |
@@ -433,7 +443,18 @@ namespace OpenSim.Services.HypergridService | |||
433 | string externalname = m_ExternalName.TrimEnd(trailing_slash); | 443 | string externalname = m_ExternalName.TrimEnd(trailing_slash); |
434 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Verifying {0} against {1}", addressee, externalname); | 444 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Verifying {0} against {1}", addressee, externalname); |
435 | 445 | ||
436 | return string.Equals(addressee, externalname, StringComparison.OrdinalIgnoreCase); | 446 | Uri uri; |
447 | try | ||
448 | { | ||
449 | uri = new Uri(addressee); | ||
450 | } | ||
451 | catch | ||
452 | { | ||
453 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Visitor provided malformed service address {0}", addressee); | ||
454 | return false; | ||
455 | } | ||
456 | |||
457 | return string.Equals(uri.GetLeftPart(UriPartial.Authority), m_Uri.GetLeftPart(UriPartial.Authority), StringComparison.OrdinalIgnoreCase) ; | ||
437 | } | 458 | } |
438 | 459 | ||
439 | #endregion | 460 | #endregion |