* move "controlLock" mutex to "config"

This commit is contained in:
Simon Zolin
2019-07-09 18:25:26 +03:00
parent d51f43e27a
commit 2682adca39
5 changed files with 9 additions and 11 deletions

View File

@@ -17,13 +17,13 @@ type accessListJSON struct {
func handleAccessList(w http.ResponseWriter, r *http.Request) {
log.Tracef("%s %v", r.Method, r.URL)
controlLock.Lock()
config.controlLock.Lock()
j := accessListJSON{
AllowedClients: config.DNS.AllowedClients,
DisallowedClients: config.DNS.DisallowedClients,
BlockedHosts: config.DNS.BlockedHosts,
}
controlLock.Unlock()
config.controlLock.Unlock()
w.Header().Set("Content-Type", "application/json")
err := json.NewEncoder(w).Encode(j)