From 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 19 May 2019 21:24:15 +1000 Subject: Dump OpenSim 0.9.0.1 into it's own branch. --- .../Hypergrid/UserAgentServiceConnector.cs | 30 ++++++++++++++-------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs') diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 8abd046..f2bb52a 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -70,9 +70,14 @@ namespace OpenSim.Services.Connectors.Hypergrid { Uri m_Uri = new Uri(m_ServerURL); IPAddress ip = Util.GetHostFromDNS(m_Uri.Host); - m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); - if (!m_ServerURL.EndsWith("/")) - m_ServerURL += "/"; + if(ip != null) + { + m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); + if (!m_ServerURL.EndsWith("/")) + m_ServerURL += "/"; + } + else + m_log.DebugFormat("[USER AGENT CONNECTOR]: Failed to resolv address of {0}", url); } catch (Exception e) { @@ -113,7 +118,7 @@ namespace OpenSim.Services.Connectors.Hypergrid return "homeagent/"; } - // The Login service calls this interface with fromLogin=true + // The Login service calls this interface with fromLogin=true // Sims call it with fromLogin=false // Either way, this is verified by the handler public bool LoginAgentToGrid(GridRegion source, AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, bool fromLogin, out string reason) @@ -138,7 +143,8 @@ namespace OpenSim.Services.Connectors.Hypergrid Console.WriteLine(" >>> LoginAgentToGrid <<< " + home.ServerURI); uint flags = fromLogin ? (uint)TeleportFlags.ViaLogin : (uint)TeleportFlags.ViaHome; - return CreateAgent(source, home, aCircuit, flags, out reason); + EntityTransferContext ctx = new EntityTransferContext(); + return CreateAgent(source, home, aCircuit, flags, ctx, out reason); } @@ -158,7 +164,7 @@ namespace OpenSim.Services.Connectors.Hypergrid } public void SetClientToken(UUID sessionID, string token) - { + { // no-op } @@ -415,7 +421,7 @@ namespace OpenSim.Services.Connectors.Hypergrid XmlRpcRequest request = new XmlRpcRequest("get_online_friends", paramList); // string reason = string.Empty; - + // Send and get reply List online = new List(); XmlRpcResponse response = null; @@ -496,7 +502,7 @@ namespace OpenSim.Services.Connectors.Hypergrid hash["userID"] = userID.ToString(); hash = CallServer("get_server_urls", hash); - + Dictionary serverURLs = new Dictionary(); foreach (object key in hash.Keys) { @@ -515,7 +521,7 @@ namespace OpenSim.Services.Connectors.Hypergrid Hashtable hash = new Hashtable(); hash["userID"] = userID.ToString(); - hash = CallServer("locate_user", hash); + hash = CallServer("locate_user", hash); string url = string.Empty; @@ -571,7 +577,11 @@ namespace OpenSim.Services.Connectors.Hypergrid XmlRpcResponse response = null; try { - response = request.Send(m_ServerURL, 10000); + // We can not use m_ServerURL here anymore because it causes + // the HTTP request to be built without a host name. This messes + // with OSGrid's NGINX and can make OSGrid avatars unable to TP + // to other grids running recent mono. + response = request.Send(m_ServerURLHost, 10000); } catch (Exception e) { -- cgit v1.1