diff options
author | Melanie | 2019-08-09 12:06:33 +0100 |
---|---|---|
committer | Melanie | 2019-08-09 12:06:33 +0100 |
commit | c9b7ec2af91792b9d6558875c2a44267ac0ac5a0 (patch) | |
tree | 872c93bfd92f83b5e03ec35c3297ce5248410f77 /OpenSim | |
parent | Merge branch 'master' of brain.opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC-c9b7ec2af91792b9d6558875c2a44267ac0ac5a0.zip opensim-SC-c9b7ec2af91792b9d6558875c2a44267ac0ac5a0.tar.gz opensim-SC-c9b7ec2af91792b9d6558875c2a44267ac0ac5a0.tar.bz2 opensim-SC-c9b7ec2af91792b9d6558875c2a44267ac0ac5a0.tar.xz |
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.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Application/Application.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 4 | ||||
-rw-r--r-- | OpenSim/Server/ServerMain.cs | 5 |
3 files changed, 8 insertions, 3 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index e4c3329..7c3b6c5 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs | |||
@@ -84,7 +84,7 @@ namespace OpenSim | |||
84 | ServicePointManager.DefaultConnectionLimit = 12; | 84 | ServicePointManager.DefaultConnectionLimit = 12; |
85 | } | 85 | } |
86 | 86 | ||
87 | try { ServicePointManager.DnsRefreshTimeout = 300000; } catch { } | 87 | try { ServicePointManager.DnsRefreshTimeout = 5000; } catch { } |
88 | ServicePointManager.Expect100Continue = false; | 88 | ServicePointManager.Expect100Continue = false; |
89 | ServicePointManager.UseNagleAlgorithm = false; | 89 | ServicePointManager.UseNagleAlgorithm = false; |
90 | 90 | ||
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index fcc8717..ee4ddf4 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -37,6 +37,7 @@ using System.Runtime; | |||
37 | using System.Text; | 37 | using System.Text; |
38 | using System.Text.RegularExpressions; | 38 | using System.Text.RegularExpressions; |
39 | using System.Timers; | 39 | using System.Timers; |
40 | using System.Net; | ||
40 | using log4net; | 41 | using log4net; |
41 | using NDesk.Options; | 42 | using NDesk.Options; |
42 | using Nini.Config; | 43 | using Nini.Config; |
@@ -119,6 +120,9 @@ namespace OpenSim | |||
119 | stpMinThreads = startupConfig.GetInt("MinPoolThreads", 2 ); | 120 | stpMinThreads = startupConfig.GetInt("MinPoolThreads", 2 ); |
120 | stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 25); | 121 | stpMaxThreads = startupConfig.GetInt("MaxPoolThreads", 25); |
121 | m_consolePrompt = startupConfig.GetString("ConsolePrompt", @"Region (\R) "); | 122 | m_consolePrompt = startupConfig.GetString("ConsolePrompt", @"Region (\R) "); |
123 | |||
124 | int dnsTimeout = startupConfig.GetInt("DnsTimeout", 30000); | ||
125 | try { ServicePointManager.DnsRefreshTimeout = dnsTimeout; } catch { } | ||
122 | } | 126 | } |
123 | 127 | ||
124 | if (Util.FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool) | 128 | if (Util.FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool) |
diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs index 09f6920..c180ca6 100644 --- a/OpenSim/Server/ServerMain.cs +++ b/OpenSim/Server/ServerMain.cs | |||
@@ -85,8 +85,6 @@ namespace OpenSim.Server | |||
85 | ServicePointManager.UseNagleAlgorithm = false; | 85 | ServicePointManager.UseNagleAlgorithm = false; |
86 | ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate; | 86 | ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate; |
87 | 87 | ||
88 | try { ServicePointManager.DnsRefreshTimeout = 300000; } catch { } | ||
89 | |||
90 | m_Server = new HttpServerBase("R.O.B.U.S.T.", args); | 88 | m_Server = new HttpServerBase("R.O.B.U.S.T.", args); |
91 | 89 | ||
92 | string registryLocation; | 90 | string registryLocation; |
@@ -98,6 +96,9 @@ namespace OpenSim.Server | |||
98 | throw new Exception("Configuration error"); | 96 | throw new Exception("Configuration error"); |
99 | } | 97 | } |
100 | 98 | ||
99 | int dnsTimeout = serverConfig.GetInt("DnsTimeout", 30000); | ||
100 | try { ServicePointManager.DnsRefreshTimeout = dnsTimeout; } catch { } | ||
101 | |||
101 | m_NoVerifyCertChain = serverConfig.GetBoolean("NoVerifyCertChain", m_NoVerifyCertChain); | 102 | m_NoVerifyCertChain = serverConfig.GetBoolean("NoVerifyCertChain", m_NoVerifyCertChain); |
102 | m_NoVerifyCertHostname = serverConfig.GetBoolean("NoVerifyCertHostname", m_NoVerifyCertHostname); | 103 | m_NoVerifyCertHostname = serverConfig.GetBoolean("NoVerifyCertHostname", m_NoVerifyCertHostname); |
103 | 104 | ||