chore: trie.DomainTrie will not depend on zero value
This commit is contained in:
@ -71,13 +71,13 @@ type fallbackDomainFilter interface {
|
||||
}
|
||||
|
||||
type domainFilter struct {
|
||||
tree *trie.DomainTrie[bool]
|
||||
tree *trie.DomainTrie[struct{}]
|
||||
}
|
||||
|
||||
func NewDomainFilter(domains []string) *domainFilter {
|
||||
df := domainFilter{tree: trie.New[bool]()}
|
||||
df := domainFilter{tree: trie.New[struct{}]()}
|
||||
for _, domain := range domains {
|
||||
_ = df.tree.Insert(domain, true)
|
||||
_ = df.tree.Insert(domain, struct{}{})
|
||||
}
|
||||
return &df
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ func withHosts(hosts *trie.DomainTrie[netip.Addr], mapping *cache.LruCache[netip
|
||||
return next(ctx, r)
|
||||
}
|
||||
|
||||
ip := record.Data
|
||||
ip := record.Data()
|
||||
msg := r.Copy()
|
||||
|
||||
if ip.Is4() && q.Qtype == D.TypeA {
|
||||
|
@ -245,7 +245,7 @@ func (r *Resolver) matchPolicy(m *D.Msg) []dnsClient {
|
||||
return nil
|
||||
}
|
||||
|
||||
p := record.Data
|
||||
p := record.Data()
|
||||
return p.GetData()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user