Skip to content

Commit

Permalink
all: dnsfilter rm config embed
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizzick committed Aug 30, 2023
1 parent 5aa6212 commit 635a316
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/filtering/blocked.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ func (d *DNSFilter) handleBlockedServicesSet(w http.ResponseWriter, r *http.Requ
func (d *DNSFilter) handleBlockedServicesGet(w http.ResponseWriter, r *http.Request) {
var bsvc *BlockedServices
func() {
d.confLock.RLock()
defer d.confLock.RUnlock()
d.confMu.RLock()
defer d.confMu.RUnlock()

bsvc = d.Config.BlockedServices.Clone()
bsvc = d.conf.BlockedServices.Clone()
}()

aghhttp.WriteJSONResponseOK(w, r, bsvc)
Expand Down Expand Up @@ -196,13 +196,13 @@ func (d *DNSFilter) handleBlockedServicesUpdate(w http.ResponseWriter, r *http.R
}

func() {
d.confLock.Lock()
defer d.confLock.Unlock()
d.confMu.Lock()
defer d.confMu.Unlock()

d.Config.BlockedServices = bsvc
d.conf.BlockedServices = bsvc
}()

log.Debug("updated blocked services schedule: %d", len(bsvc.IDs))

d.Config.ConfigModified()
d.conf.ConfigModified()
}

0 comments on commit 635a316

Please sign in to comment.