diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index a3c77508d1..f52a84c2e0 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -991,7 +991,7 @@ namespace OpenSim.Framework return output.ToString(); } - static ExpiringCache dnscache = new ExpiringCache(); + private static ExpiringCache dnscache = new ExpiringCache(); /// /// Converts a URL to a IPAddress @@ -1015,7 +1015,10 @@ namespace OpenSim.Framework IPAddress ia = null; if(dnscache.TryGetValue(dnsAddress, out ia) && ia != null) + { + dnscache.AddOrUpdate(dnsAddress, ia, 300); return ia; + } ia = null; // If it is already an IP, don't let GetHostEntry see it @@ -1081,7 +1084,10 @@ namespace OpenSim.Framework IPAddress ia = null; if(dnscache.TryGetValue(hostname, out ia) && ia != null) + { + dnscache.AddOrUpdate(hostname, ia, 300); return getEndPoint(ia, port); + } ia = null; diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 447afb4654..66ce8e5e3d 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -79,10 +79,9 @@ namespace OpenSim else { ServicePointManager.DefaultConnectionLimit = 12; - try { ServicePointManager.DnsRefreshTimeout = 120000; } // just is case some crazy mono decides to have it infinity - catch { } } + try { ServicePointManager.DnsRefreshTimeout = 300000; } catch { } ServicePointManager.Expect100Continue = false; ServicePointManager.UseNagleAlgorithm = false; diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs index accf9385ff..69d0b74d0d 100644 --- a/OpenSim/Server/ServerMain.cs +++ b/OpenSim/Server/ServerMain.cs @@ -59,8 +59,7 @@ namespace OpenSim.Server ServicePointManager.Expect100Continue = false; ServicePointManager.UseNagleAlgorithm = false; - try { ServicePointManager.DnsRefreshTimeout = 120000; } // just is case some mono decides to have it infinity - catch { } + try { ServicePointManager.DnsRefreshTimeout = 300000; } catch { } m_Server = new HttpServerBase("R.O.B.U.S.T.", args);