all: resync with master
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/netip"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
@@ -629,3 +630,19 @@ func (d *DNSFilter) enableFiltersLocked(async bool) {
|
||||
|
||||
d.SetEnabled(d.conf.FilteringEnabled)
|
||||
}
|
||||
|
||||
// ApplyAdditionalFiltering enhances the provided filtering settings with
|
||||
// blocked services and client-specific configurations.
|
||||
func (d *DNSFilter) ApplyAdditionalFiltering(cliAddr netip.Addr, clientID string, setts *Settings) {
|
||||
d.ApplyBlockedServices(setts)
|
||||
|
||||
d.applyClientFiltering(clientID, cliAddr, setts)
|
||||
if setts.BlockedServices != nil {
|
||||
// TODO(e.burkov): Get rid of this crutch.
|
||||
setts.ServicesRules = nil
|
||||
svcs := setts.BlockedServices.IDs
|
||||
if !setts.BlockedServices.Schedule.Contains(time.Now()) {
|
||||
d.ApplyBlockedServicesList(setts, svcs)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user