Pull request: all: fix client id handling in querylog
Merge in DNS/adguard-home from 2607-querylog-client-id to master Closes #2607. Squashed commit of the following: commit 95367a82469af3b042489fb650b962b48cb73236 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Jan 28 19:02:02 2021 +0300 all: fix client, imp docs commit b652a7ef2373a75f7e897d29f5c9e36b0e076f8e Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Jan 28 18:36:17 2021 +0300 all: fix client id handling in querylog
This commit is contained in:
@@ -264,8 +264,12 @@ func (clients *clientsContainer) handleFindClient(w http.ResponseWriter, r *http
|
||||
// findTemporary looks up the IP in temporary storages, like autohosts or
|
||||
// blocklists.
|
||||
func (clients *clientsContainer) findTemporary(ip net.IP, idStr string) (cj clientJSON, found bool) {
|
||||
if ip == nil {
|
||||
return cj, false
|
||||
}
|
||||
|
||||
ch, ok := clients.FindAutoClient(idStr)
|
||||
if !ok && ip != nil {
|
||||
if !ok {
|
||||
// It is still possible that the IP used to be in the runtime
|
||||
// clients list, but then the server was reloaded. So, check
|
||||
// the DNS server's blocked IP list.
|
||||
@@ -286,9 +290,7 @@ func (clients *clientsContainer) findTemporary(ip net.IP, idStr string) (cj clie
|
||||
}
|
||||
|
||||
cj = clientHostToJSON(idStr, ch)
|
||||
if ip != nil {
|
||||
cj.Disallowed, cj.DisallowedRule = clients.dnsServer.IsBlockedIP(ip)
|
||||
}
|
||||
cj.Disallowed, cj.DisallowedRule = clients.dnsServer.IsBlockedIP(ip)
|
||||
|
||||
return cj, true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user