优化IP黑名单检测

This commit is contained in:
GoEdgeLab
2023-04-05 09:25:33 +08:00
parent b9bfcee79c
commit 9ba3dc8172
7 changed files with 36 additions and 29 deletions

View File

@@ -8,8 +8,9 @@ import (
// DropTemporaryTo 使用本地防火墙临时拦截IP数据包
func DropTemporaryTo(ip string, expiresAt int64) {
if expiresAt <= 1 {
return
// 如果为0则表示是长期有效
if expiresAt <= 0 {
expiresAt = time.Now().Unix() + 3600
}
var timeout = expiresAt - time.Now().Unix()