- DNS: fix slow response to /status and /access/list requests

This commit is contained in:
Simon Zolin
2019-12-17 13:09:03 +03:00
parent 04de9d0f7b
commit 8521635f63
4 changed files with 7 additions and 7 deletions

View File

@@ -119,13 +119,13 @@ type accessListJSON struct {
}
func (s *Server) handleAccessList(w http.ResponseWriter, r *http.Request) {
s.Lock()
s.RLock()
j := accessListJSON{
AllowedClients: s.conf.AllowedClients,
DisallowedClients: s.conf.DisallowedClients,
BlockedHosts: s.conf.BlockedHosts,
}
s.Unlock()
s.RUnlock()
w.Header().Set("Content-Type", "application/json")
err := json.NewEncoder(w).Encode(j)