From d96f5fa57db52c872b8e431bc9a1137f0525cbc5 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 2 Sep 2010 16:36:05 -0700 Subject: Quick fix for making global references for gatekeepers that are not domain:port work. This needs a serious rewrite, as the assumption domain:port doesn't hold from here on. Just quick-fixing for now. --- .../Hypergrid/GatekeeperServiceConnector.cs | 6 +++--- .../Hypergrid/UserAgentServiceConnector.cs | 7 ++++--- .../Simulation/SimulationServiceConnector.cs | 24 ++++++++++++++-------- 3 files changed, 22 insertions(+), 15 deletions(-) (limited to 'OpenSim/Services/Connectors') diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index 024b42d..77e3b20 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -86,8 +86,8 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("link_region", paramList); - string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"; - //m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri); + string uri = "http://" + ((info.ServerURI == string.Empty) ? info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" : info.ServerURI); + m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri); XmlRpcResponse response = null; try { @@ -188,7 +188,7 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("get_region", paramList); - string uri = "http://" + gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/"; + string uri = "http://" + ((gatekeeper.ServerURI == string.Empty) ? gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/" : gatekeeper.ServerURI); m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri); XmlRpcResponse response = null; try diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 4501937..7fa086a 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -51,15 +51,16 @@ namespace OpenSim.Services.Connectors.Hypergrid MethodBase.GetCurrentMethod().DeclaringType); string m_ServerURL; - Uri m_Uri; public UserAgentServiceConnector(string url) { m_ServerURL = url; + // Doing this here, because XML-RPC or mono have some strong ideas about + // caching DNS translations. try { - m_Uri = new Uri(m_ServerURL); + Uri m_Uri = new Uri(m_ServerURL); IPAddress ip = Util.GetHostFromDNS(m_Uri.Host); - m_ServerURL = "http://" + ip.ToString() + ":" + m_Uri.Port; + m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); ; } catch (Exception e) { diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 2b96b96..df818f5 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -104,17 +104,23 @@ namespace OpenSim.Services.Connectors.Simulation return false; } - // Eventually, we want to use a caps url instead of the agentID string uri = string.Empty; - try - { - uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/"; - } - catch (Exception e) + + // HACK -- Simian grid make it work!!! + if (destination.ServerURI != string.Empty) + uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/"; + else { - m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message); - reason = e.Message; - return false; + try + { + uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/"; + } + catch (Exception e) + { + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message); + reason = e.Message; + return false; + } } //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri); -- cgit v1.1 From 85e9160552ea72e469863e077d1084da80e12222 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 3 Sep 2010 09:02:08 -0700 Subject: More tweaks related to my previous commit. Tweaks sux. --- OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | 4 ++-- OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Services/Connectors') diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index 77e3b20..dd156aa 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -86,7 +86,7 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("link_region", paramList); - string uri = "http://" + ((info.ServerURI == string.Empty) ? info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" : info.ServerURI); + string uri = "http://" + ((info.ServerURI == string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" : info.ServerURI); m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri); XmlRpcResponse response = null; try @@ -188,7 +188,7 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("get_region", paramList); - string uri = "http://" + ((gatekeeper.ServerURI == string.Empty) ? gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/" : gatekeeper.ServerURI); + string uri = "http://" + ((gatekeeper.ServerURI == string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/" : gatekeeper.ServerURI); m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri); XmlRpcResponse response = null; try diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index df818f5..b2dec96 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -107,7 +107,7 @@ namespace OpenSim.Services.Connectors.Simulation string uri = string.Empty; // HACK -- Simian grid make it work!!! - if (destination.ServerURI != string.Empty) + if (destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:")) uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/"; else { -- cgit v1.1 From 77384eb28b51d89ac73bd76346790e7a6b68a2f3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 3 Sep 2010 09:26:33 -0700 Subject: Another tweak. Sux^2 --- OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services/Connectors') diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index dd156aa..7431f04 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -86,7 +86,7 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("link_region", paramList); - string uri = "http://" + ((info.ServerURI == string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" : info.ServerURI); + string uri = "http://" + ((info.ServerURI != string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ServerURI : info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" ); m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri); XmlRpcResponse response = null; try @@ -188,7 +188,7 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("get_region", paramList); - string uri = "http://" + ((gatekeeper.ServerURI == string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/" : gatekeeper.ServerURI); + string uri = "http://" + ((gatekeeper.ServerURI != string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ServerURI : gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/" ); m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri); XmlRpcResponse response = null; try -- cgit v1.1 From 5bbf793f9e7c1607d1ebb01e886375c1a74adafb Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 3 Sep 2010 10:01:18 -0700 Subject: One last tweak, hopefully. --- OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Services/Connectors') diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index 7431f04..f5b5982 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -86,7 +86,7 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("link_region", paramList); - string uri = "http://" + ((info.ServerURI != string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ServerURI : info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" ); + string uri = "http://" + ((info.ServerURI != null && info.ServerURI != string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ServerURI : info.ExternalEndPoint.Address + ":" + info.HttpPort + "/" ); m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri); XmlRpcResponse response = null; try @@ -188,7 +188,7 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("get_region", paramList); - string uri = "http://" + ((gatekeeper.ServerURI != string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ServerURI : gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/" ); + string uri = "http://" + ((gatekeeper.ServerURI != null && gatekeeper.ServerURI != string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ServerURI : gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/"); m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri); XmlRpcResponse response = null; try -- cgit v1.1 From a5cce8d6d721da5e6f63a9564f531bf27be75320 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 3 Sep 2010 10:13:41 -0700 Subject: Last+1 tweak. --- OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services/Connectors') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index b2dec96..c7d1869 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -107,7 +107,7 @@ namespace OpenSim.Services.Connectors.Simulation string uri = string.Empty; // HACK -- Simian grid make it work!!! - if (destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:")) + if (destination != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:")) uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/"; else { -- cgit v1.1 From 0a0f38b23c2674d98ab055b23d4bbd20896cc4fd Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 3 Sep 2010 10:31:16 -0700 Subject: Last+2 tweak --- OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Services/Connectors') diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index c7d1869..a5f748f 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -107,7 +107,7 @@ namespace OpenSim.Services.Connectors.Simulation string uri = string.Empty; // HACK -- Simian grid make it work!!! - if (destination != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:")) + if (destination.ServerURI != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:")) uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/"; else { -- cgit v1.1