From 5ade01bb493919c65eb3a9c0fc3f76710eea018c Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Wed, 12 Sep 2007 05:37:46 +0000 Subject: [PATCH] Fixed DNS resolve bug for Grid mode on multi-Homer systems. --- OpenSim/Framework/Data/SimProfileData.cs | 1 + OpenSim/Framework/General/Util.cs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/OpenSim/Framework/Data/SimProfileData.cs b/OpenSim/Framework/Data/SimProfileData.cs index abde1f3710..27bbd6088e 100644 --- a/OpenSim/Framework/Data/SimProfileData.cs +++ b/OpenSim/Framework/Data/SimProfileData.cs @@ -164,6 +164,7 @@ namespace OpenSim.Framework.Data ArrayList SendParams = new ArrayList(); SendParams.Add(requestData); XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); + Console.WriteLine("Requesting response from GridServer URL: " + gridserver_url); XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000); Hashtable responseData = (Hashtable)GridResp.Value; diff --git a/OpenSim/Framework/General/Util.cs b/OpenSim/Framework/General/Util.cs index a263d7e1e8..fe4ce29493 100644 --- a/OpenSim/Framework/General/Util.cs +++ b/OpenSim/Framework/General/Util.cs @@ -249,6 +249,13 @@ namespace OpenSim.Framework.Utilities /// An IP address, or null public static IPAddress GetHostFromDNS(string dnsAddress) { + + // Is it already a valid IP? No need to look it up. + IPAddress ipa; + if (IPAddress.TryParse(dnsAddress, out ipa)) + return ipa; + + // Not an IP, lookup required IPAddress[] hosts = Dns.GetHostEntry(dnsAddress).AddressList; foreach (IPAddress host in hosts)