aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-04-14 15:32:39 +0000
committerJustin Clarke Casey2008-04-14 15:32:39 +0000
commit5c52068dd7a3bea8ff31e78bf933a985ef97f1b4 (patch)
tree651ad51ea559c4fa752278de0108e2d97e5c9ebf /OpenSim/Framework/Util.cs
parentmake it so the IRC bridge only relays channel 0 messages (diff)
downloadopensim-SC_OLD-5c52068dd7a3bea8ff31e78bf933a985ef97f1b4.zip
opensim-SC_OLD-5c52068dd7a3bea8ff31e78bf933a985ef97f1b4.tar.gz
opensim-SC_OLD-5c52068dd7a3bea8ff31e78bf933a985ef97f1b4.tar.bz2
opensim-SC_OLD-5c52068dd7a3bea8ff31e78bf933a985ef97f1b4.tar.xz
* Get Util.GetHostFromDNS to tell us the dns address it was trying to resolve if it fails.
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r--OpenSim/Framework/Util.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index a184f89..ac1145f 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -43,6 +43,8 @@ namespace OpenSim.Framework
43{ 43{
44 public class Util 44 public class Util
45 { 45 {
46 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
47
46 private static Random randomClass = new Random(); 48 private static Random randomClass = new Random();
47 private static uint nextXferID = 5000; 49 private static uint nextXferID = 5000;
48 private static object XferLock = new object(); 50 private static object XferLock = new object();
@@ -327,8 +329,20 @@ namespace OpenSim.Framework
327 if (IPAddress.TryParse(dnsAddress, out ipa)) 329 if (IPAddress.TryParse(dnsAddress, out ipa))
328 return ipa; 330 return ipa;
329 331
332 IPAddress[] hosts = null;
333
330 // Not an IP, lookup required 334 // Not an IP, lookup required
331 IPAddress[] hosts = Dns.GetHostEntry(dnsAddress).AddressList; 335 try
336 {
337 hosts = Dns.GetHostEntry(dnsAddress).AddressList;
338 }
339 catch (Exception e)
340 {
341 m_log.ErrorFormat("[UTIL]: An error occurred while resolving {0}, {1}", dnsAddress, e);
342
343 // Still going to throw the exception on for now, since this was what was happening in the first place
344 throw e;
345 }
332 346
333 foreach (IPAddress host in hosts) 347 foreach (IPAddress host in hosts)
334 { 348 {