mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-22 18:08:14 -05:00
clear user
This commit is contained in:
parent
8890b566d5
commit
97b7322492
@ -130,9 +130,11 @@ func (c *ConnLimiter) DelConnCount(user string, ip string) {
|
|||||||
|
|
||||||
// ClearOnlineIP Clear udp,icmp and other packet protocol online ip
|
// ClearOnlineIP Clear udp,icmp and other packet protocol online ip
|
||||||
func (c *ConnLimiter) ClearOnlineIP() {
|
func (c *ConnLimiter) ClearOnlineIP() {
|
||||||
c.ip.Range(func(_, v any) bool {
|
c.ip.Range(func(u, v any) bool {
|
||||||
userIp := v.(*sync.Map)
|
userIp := v.(*sync.Map)
|
||||||
|
notDel := false
|
||||||
userIp.Range(func(ip, v any) bool {
|
userIp.Range(func(ip, v any) bool {
|
||||||
|
notDel = true
|
||||||
if _, ok := v.(int); ok {
|
if _, ok := v.(int); ok {
|
||||||
if v.(int) == 1 {
|
if v.(int) == 1 {
|
||||||
// clear packet ip for realtime
|
// clear packet ip for realtime
|
||||||
@ -148,6 +150,9 @@ func (c *ConnLimiter) ClearOnlineIP() {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
if !notDel {
|
||||||
|
c.ip.Delete(u)
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user