all: sync with master; upd chlog

This commit is contained in:
Ainar Garipov
2023-09-07 17:13:48 +03:00
parent 3be7676970
commit 7b93f5d7cf
306 changed files with 19770 additions and 4916 deletions

View File

@@ -12,8 +12,8 @@ import (
//
// Deprecated: Use handleSafeSearchSettings.
func (d *DNSFilter) handleSafeSearchEnable(w http.ResponseWriter, r *http.Request) {
setProtectedBool(&d.confLock, &d.Config.SafeSearchConf.Enabled, true)
d.Config.ConfigModified()
setProtectedBool(d.confMu, &d.conf.SafeSearchConf.Enabled, true)
d.conf.ConfigModified()
}
// handleSafeSearchDisable is the handler for POST /control/safesearch/disable
@@ -21,8 +21,8 @@ func (d *DNSFilter) handleSafeSearchEnable(w http.ResponseWriter, r *http.Reques
//
// Deprecated: Use handleSafeSearchSettings.
func (d *DNSFilter) handleSafeSearchDisable(w http.ResponseWriter, r *http.Request) {
setProtectedBool(&d.confLock, &d.Config.SafeSearchConf.Enabled, false)
d.Config.ConfigModified()
setProtectedBool(d.confMu, &d.conf.SafeSearchConf.Enabled, false)
d.conf.ConfigModified()
}
// handleSafeSearchStatus is the handler for GET /control/safesearch/status
@@ -30,13 +30,13 @@ func (d *DNSFilter) handleSafeSearchDisable(w http.ResponseWriter, r *http.Reque
func (d *DNSFilter) handleSafeSearchStatus(w http.ResponseWriter, r *http.Request) {
var resp SafeSearchConfig
func() {
d.confLock.RLock()
defer d.confLock.RUnlock()
d.confMu.RLock()
defer d.confMu.RUnlock()
resp = d.Config.SafeSearchConf
resp = d.conf.SafeSearchConf
}()
_ = aghhttp.WriteJSONResponse(w, r, resp)
aghhttp.WriteJSONResponseOK(w, r, resp)
}
// handleSafeSearchSettings is the handler for PUT /control/safesearch/settings
@@ -59,13 +59,13 @@ func (d *DNSFilter) handleSafeSearchSettings(w http.ResponseWriter, r *http.Requ
}
func() {
d.confLock.Lock()
defer d.confLock.Unlock()
d.confMu.Lock()
defer d.confMu.Unlock()
d.Config.SafeSearchConf = conf
d.conf.SafeSearchConf = conf
}()
d.Config.ConfigModified()
d.conf.ConfigModified()
aghhttp.OK(w)
}