删除IP名单中某个IP时,也会删除WAF保存在内存中的名单中的IP

This commit is contained in:
GoEdgeLab
2021-11-05 14:58:10 +08:00
parent e36b214cf0
commit 8174713431
3 changed files with 20 additions and 0 deletions

View File

@@ -80,6 +80,14 @@ func (this *IPList) Contains(ipType string, scope firewallconfigs.FirewallScope,
return ok
}
// RemoveIP 删除IP
// 暂时没办法清除某个服务相关的IP
func (this *IPList) RemoveIP(ip string) {
this.locker.Lock()
delete(this.ipMap, "*@"+ip+"@"+IPTypeAll)
this.locker.Unlock()
}
func (this *IPList) remove(id int64) {
this.locker.Lock()
ip, ok := this.idMap[id]