Pull request 1812: AG-21286

Merge in DNS/adguard-home from AG-21286 to master

Squashed commit of the following:

commit 587b4a3704fd63aa3da6c1be83f8a49bf4e27b00
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Apr 11 14:15:05 2023 +0300

    all: fix negative pause duration
This commit is contained in:
Ainar Garipov
2023-04-11 15:02:29 +03:00
parent 9e14d5f99f
commit 950ecb1f5e
4 changed files with 41 additions and 34 deletions

View File

@@ -101,7 +101,7 @@ type jsonDNSConfig struct {
}
func (s *Server) getDNSConfig() (c *jsonDNSConfig) {
protectionEnabled := s.UpdatedProtectionStatus()
protectionEnabled, protectionDisabledUntil := s.UpdatedProtectionStatus()
s.serverLock.RLock()
defer s.serverLock.RUnlock()
@@ -128,12 +128,6 @@ func (s *Server) getDNSConfig() (c *jsonDNSConfig) {
usePrivateRDNS := s.conf.UsePrivateRDNS
localPTRUpstreams := stringutil.CloneSliceOrEmpty(s.conf.LocalPTRResolvers)
var disabledUntil *time.Time
if s.conf.ProtectionDisabledUntil != nil {
t := *s.conf.ProtectionDisabledUntil
disabledUntil = &t
}
var upstreamMode string
if s.conf.FastestAddr {
upstreamMode = "fastest_addr"
@@ -169,7 +163,7 @@ func (s *Server) getDNSConfig() (c *jsonDNSConfig) {
UsePrivateRDNS: &usePrivateRDNS,
LocalPTRUpstreams: &localPTRUpstreams,
DefaultLocalPTRUpstreams: defLocalPTRUps,
DisabledUntil: disabledUntil,
DisabledUntil: protectionDisabledUntil,
}
}