mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
fix #197
This commit is contained in:
parent
8a33d68cf1
commit
f6eb8fa5a1
2 changed files with 5 additions and 7 deletions
|
|
@ -58,13 +58,8 @@ func (cl *Limiter) AddClient(addr net.IP, force bool) error {
|
|||
cl.Lock()
|
||||
defer cl.Unlock()
|
||||
|
||||
if !cl.enabled {
|
||||
return nil
|
||||
}
|
||||
|
||||
// check exempted lists
|
||||
// we don't track populations for exempted addresses or nets - this is by design
|
||||
if utils.IPInNets(addr, cl.exemptedNets) {
|
||||
if !cl.enabled || utils.IPInNets(addr, cl.exemptedNets) {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +80,7 @@ func (cl *Limiter) RemoveClient(addr net.IP) {
|
|||
cl.Lock()
|
||||
defer cl.Unlock()
|
||||
|
||||
if !cl.enabled {
|
||||
if !cl.enabled || utils.IPInNets(addr, cl.exemptedNets) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue