*(home): do not set whois-info for manually created clients

 Closes: Do not set WhoisInfo for manually created clients
This commit is contained in:
Andrey Meshkov
2019-12-23 20:02:06 +03:00
parent cdd55139fa
commit 3a077717ae
3 changed files with 7 additions and 8 deletions

View File

@@ -176,7 +176,7 @@ func (clients *clientsContainer) Exists(ip string, source clientSource) bool {
clients.lock.Lock()
defer clients.lock.Unlock()
_, ok := clients.idIndex[ip]
_, ok := clients.findByIP(ip)
if ok {
return true
}
@@ -484,10 +484,9 @@ func (clients *clientsContainer) SetWhoisInfo(ip string, info [][]string) {
clients.lock.Lock()
defer clients.lock.Unlock()
c, ok := clients.idIndex[ip]
_, ok := clients.findByIP(ip)
if ok {
c.WhoisInfo = info
log.Debug("Clients: set WHOIS info for client %s: %v", c.Name, c.WhoisInfo)
log.Debug("Clients: client for %s is already created, ignore WHOIS info", ip)
return
}