Pull request: 1992 configurable timeouts
Merge in DNS/adguard-home from 1992-conf-timeouts to master
Updates #1992.
Squashed commit of the following:
commit 1050c54fb407bec0617728690763b0392b3440b0
Merge: 05f71c3e 59544160
Author: Eugene Burkov <e.burkov@adguard.com>
Date: Fri Aug 27 20:04:25 2021 +0300
Merge branch 'master' into 1992-conf-timeouts
commit 05f71c3e5397909d943e69d49a247bf4f67619b0
Author: Eugene Burkov <e.burkov@adguard.com>
Date: Fri Aug 27 20:03:06 2021 +0300
home: use const
commit d0861792b42e6d066aa3ffdb3937e29477235ee0
Author: Eugene Burkov <e.burkov@adguard.com>
Date: Fri Aug 27 19:16:26 2021 +0300
home: fix default timeout
commit ba26fcdcf66366350c89d5a82c4da91ade45838f
Author: Eugene Burkov <e.burkov@adguard.com>
Date: Fri Aug 27 16:50:33 2021 +0300
all: mk ping timeout configurable
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/AdguardTeam/AdGuardHome/internal/aghtime"
|
||||
"github.com/AdguardTeam/AdGuardHome/internal/filtering"
|
||||
"github.com/AdguardTeam/dnsproxy/proxy"
|
||||
"github.com/AdguardTeam/dnsproxy/upstream"
|
||||
@@ -87,6 +88,9 @@ type FilteringConfig struct {
|
||||
BootstrapDNS []string `yaml:"bootstrap_dns"` // a list of bootstrap DNS for DoH and DoT (plain DNS only)
|
||||
AllServers bool `yaml:"all_servers"` // if true, parallel queries to all configured upstream servers are enabled
|
||||
FastestAddr bool `yaml:"fastest_addr"` // use Fastest Address algorithm
|
||||
// FastestTimeout replaces the default timeout for dialing IP addresses
|
||||
// when FastestAddr is true.
|
||||
FastestTimeout aghtime.Duration `yaml:"fastest_timeout"`
|
||||
|
||||
// Access settings
|
||||
// --
|
||||
@@ -236,6 +240,7 @@ func (s *Server) createProxyConfig() (proxy.Config, error) {
|
||||
proxyConfig.UpstreamMode = proxy.UModeParallel
|
||||
} else if s.conf.FastestAddr {
|
||||
proxyConfig.UpstreamMode = proxy.UModeFastestAddr
|
||||
proxyConfig.FastestPingTimeout = s.conf.FastestTimeout.Duration
|
||||
}
|
||||
|
||||
if len(s.conf.BogusNXDomain) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user