mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2026-02-03 22:45:48 +08:00
优化代码
This commit is contained in:
@@ -135,7 +135,7 @@ func (this *ClientConn) checkSYNFlood() {
|
||||
|
||||
var ip = this.RawIP()
|
||||
if len(ip) > 0 && !iplibrary.IsInWhiteList(ip) && (!synFloodConfig.IgnoreLocal || !utils.IsLocalIP(ip)) {
|
||||
var timestamp = (utils.UnixTime()/60)*60 + 60
|
||||
var timestamp = utils.NextMinuteUnixTime()
|
||||
var result = ttlcache.SharedCache.IncreaseInt64("SYN_FLOOD:"+ip, 1, timestamp)
|
||||
var minAttempts = synFloodConfig.MinAttempts
|
||||
if minAttempts < 3 {
|
||||
|
||||
Reference in New Issue
Block a user