diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | 30 |
1 files changed, 20 insertions, 10 deletions
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 | |||
70 | { | 70 | { |
71 | Uri m_Uri = new Uri(m_ServerURL); | 71 | Uri m_Uri = new Uri(m_ServerURL); |
72 | IPAddress ip = Util.GetHostFromDNS(m_Uri.Host); | 72 | IPAddress ip = Util.GetHostFromDNS(m_Uri.Host); |
73 | m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); | 73 | if(ip != null) |
74 | if (!m_ServerURL.EndsWith("/")) | 74 | { |
75 | m_ServerURL += "/"; | 75 | m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); |
76 | if (!m_ServerURL.EndsWith("/")) | ||
77 | m_ServerURL += "/"; | ||
78 | } | ||
79 | else | ||
80 | m_log.DebugFormat("[USER AGENT CONNECTOR]: Failed to resolv address of {0}", url); | ||
76 | } | 81 | } |
77 | catch (Exception e) | 82 | catch (Exception e) |
78 | { | 83 | { |
@@ -113,7 +118,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
113 | return "homeagent/"; | 118 | return "homeagent/"; |
114 | } | 119 | } |
115 | 120 | ||
116 | // The Login service calls this interface with fromLogin=true | 121 | // The Login service calls this interface with fromLogin=true |
117 | // Sims call it with fromLogin=false | 122 | // Sims call it with fromLogin=false |
118 | // Either way, this is verified by the handler | 123 | // Either way, this is verified by the handler |
119 | public bool LoginAgentToGrid(GridRegion source, AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, bool fromLogin, out string reason) | 124 | 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 | |||
138 | Console.WriteLine(" >>> LoginAgentToGrid <<< " + home.ServerURI); | 143 | Console.WriteLine(" >>> LoginAgentToGrid <<< " + home.ServerURI); |
139 | 144 | ||
140 | uint flags = fromLogin ? (uint)TeleportFlags.ViaLogin : (uint)TeleportFlags.ViaHome; | 145 | uint flags = fromLogin ? (uint)TeleportFlags.ViaLogin : (uint)TeleportFlags.ViaHome; |
141 | return CreateAgent(source, home, aCircuit, flags, out reason); | 146 | EntityTransferContext ctx = new EntityTransferContext(); |
147 | return CreateAgent(source, home, aCircuit, flags, ctx, out reason); | ||
142 | } | 148 | } |
143 | 149 | ||
144 | 150 | ||
@@ -158,7 +164,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
158 | } | 164 | } |
159 | 165 | ||
160 | public void SetClientToken(UUID sessionID, string token) | 166 | public void SetClientToken(UUID sessionID, string token) |
161 | { | 167 | { |
162 | // no-op | 168 | // no-op |
163 | } | 169 | } |
164 | 170 | ||
@@ -415,7 +421,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
415 | 421 | ||
416 | XmlRpcRequest request = new XmlRpcRequest("get_online_friends", paramList); | 422 | XmlRpcRequest request = new XmlRpcRequest("get_online_friends", paramList); |
417 | // string reason = string.Empty; | 423 | // string reason = string.Empty; |
418 | 424 | ||
419 | // Send and get reply | 425 | // Send and get reply |
420 | List<UUID> online = new List<UUID>(); | 426 | List<UUID> online = new List<UUID>(); |
421 | XmlRpcResponse response = null; | 427 | XmlRpcResponse response = null; |
@@ -496,7 +502,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
496 | hash["userID"] = userID.ToString(); | 502 | hash["userID"] = userID.ToString(); |
497 | 503 | ||
498 | hash = CallServer("get_server_urls", hash); | 504 | hash = CallServer("get_server_urls", hash); |
499 | 505 | ||
500 | Dictionary<string, object> serverURLs = new Dictionary<string, object>(); | 506 | Dictionary<string, object> serverURLs = new Dictionary<string, object>(); |
501 | foreach (object key in hash.Keys) | 507 | foreach (object key in hash.Keys) |
502 | { | 508 | { |
@@ -515,7 +521,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
515 | Hashtable hash = new Hashtable(); | 521 | Hashtable hash = new Hashtable(); |
516 | hash["userID"] = userID.ToString(); | 522 | hash["userID"] = userID.ToString(); |
517 | 523 | ||
518 | hash = CallServer("locate_user", hash); | 524 | hash = CallServer("locate_user", hash); |
519 | 525 | ||
520 | string url = string.Empty; | 526 | string url = string.Empty; |
521 | 527 | ||
@@ -571,7 +577,11 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
571 | XmlRpcResponse response = null; | 577 | XmlRpcResponse response = null; |
572 | try | 578 | try |
573 | { | 579 | { |
574 | response = request.Send(m_ServerURL, 10000); | 580 | // We can not use m_ServerURL here anymore because it causes |
581 | // the HTTP request to be built without a host name. This messes | ||
582 | // with OSGrid's NGINX and can make OSGrid avatars unable to TP | ||
583 | // to other grids running recent mono. | ||
584 | response = request.Send(m_ServerURLHost, 10000); | ||
575 | } | 585 | } |
576 | catch (Exception e) | 586 | catch (Exception e) |
577 | { | 587 | { |