Make the DNS cache timeout configurable.

In containerized environments, DNS is simulated. It can change several
times per second as containers move around. The hardcoded timeout was
too long for a container environment.
This commit is contained in:
Melanie
2019-08-09 12:06:33 +01:00
parent f332f3fc41
commit c9b7ec2af9
3 changed files with 8 additions and 3 deletions

View File

@@ -85,8 +85,6 @@ namespace OpenSim.Server
ServicePointManager.UseNagleAlgorithm = false;
ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
try { ServicePointManager.DnsRefreshTimeout = 300000; } catch { }
m_Server = new HttpServerBase("R.O.B.U.S.T.", args);
string registryLocation;
@@ -98,6 +96,9 @@ namespace OpenSim.Server
throw new Exception("Configuration error");
}
int dnsTimeout = serverConfig.GetInt("DnsTimeout", 30000);
try { ServicePointManager.DnsRefreshTimeout = dnsTimeout; } catch { }
m_NoVerifyCertChain = serverConfig.GetBoolean("NoVerifyCertChain", m_NoVerifyCertChain);
m_NoVerifyCertHostname = serverConfig.GetBoolean("NoVerifyCertHostname", m_NoVerifyCertHostname);