"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "internal/home/clients.go" between
AdGuardHome-0.105.1.tar.gz and AdGuardHome-0.105.2.tar.gz

About: AdGuard Home is a network-wide ads & trackers blocking DNS server. It operates as a DNS server that re-routes tracking domains to a "black hole," thus preventing your devices from connecting to those servers.

clients.go  (AdGuardHome-0.105.1):clients.go  (AdGuardHome-0.105.2)
skipping to change at line 20 skipping to change at line 20
"strings" "strings"
"sync" "sync"
"time" "time"
"github.com/AdguardTeam/AdGuardHome/internal/agherr" "github.com/AdguardTeam/AdGuardHome/internal/agherr"
"github.com/AdguardTeam/AdGuardHome/internal/dhcpd" "github.com/AdguardTeam/AdGuardHome/internal/dhcpd"
"github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter"
"github.com/AdguardTeam/AdGuardHome/internal/dnsforward" "github.com/AdguardTeam/AdGuardHome/internal/dnsforward"
"github.com/AdguardTeam/AdGuardHome/internal/util" "github.com/AdguardTeam/AdGuardHome/internal/util"
"github.com/AdguardTeam/dnsproxy/proxy" "github.com/AdguardTeam/dnsproxy/proxy"
"github.com/AdguardTeam/dnsproxy/upstream"
"github.com/AdguardTeam/golibs/log" "github.com/AdguardTeam/golibs/log"
"github.com/AdguardTeam/golibs/utils" "github.com/AdguardTeam/golibs/utils"
) )
const clientsUpdatePeriod = 10 * time.Minute const clientsUpdatePeriod = 10 * time.Minute
var webHandlersRegistered = false var webHandlersRegistered = false
// Client contains information about persistent clients. // Client contains information about persistent clients.
type Client struct { type Client struct {
skipping to change at line 298 skipping to change at line 299
c, ok := clients.findLocked(ip) c, ok := clients.findLocked(ip)
if !ok { if !ok {
return nil return nil
} }
if len(c.Upstreams) == 0 { if len(c.Upstreams) == 0 {
return nil return nil
} }
if c.upstreamConfig == nil { if c.upstreamConfig == nil {
config, err := proxy.ParseUpstreamsConfig(c.Upstreams, config.DNS config, err := proxy.ParseUpstreamsConfig(c.Upstreams,
.BootstrapDNS, dnsforward.DefaultTimeout) upstream.Options{
Bootstrap: config.DNS.BootstrapDNS,
Timeout: dnsforward.DefaultTimeout,
},
)
if err == nil { if err == nil {
c.upstreamConfig = &config c.upstreamConfig = &config
} }
} }
return c.upstreamConfig return c.upstreamConfig
} }
// findLocked searches for a client by its ID. For internal use only. // findLocked searches for a client by its ID. For internal use only.
func (clients *clientsContainer) findLocked(id string) (c *Client, ok bool) { func (clients *clientsContainer) findLocked(id string) (c *Client, ok bool) {
 End of changes. 2 change blocks. 
2 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)