From 2a1cc639893e4a65d3f8923f1e2b30f538989a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Thu, 13 Jan 2022 11:46:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/client_conn.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/nodes/client_conn.go b/internal/nodes/client_conn.go index 081a778..769918a 100644 --- a/internal/nodes/client_conn.go +++ b/internal/nodes/client_conn.go @@ -67,17 +67,17 @@ func (this *ClientConn) Read(b []byte) (n int, err error) { // SYN Flood检测 var isHandshakeError = err != nil && os.IsTimeout(err) && !this.hasRead + if isHandshakeError { + _ = this.SetLinger(0) + } var synFloodConfig = sharedNodeConfig.SYNFloodConfig() if synFloodConfig != nil && synFloodConfig.IsOn { if isHandshakeError { - _ = this.SetLinger(0) this.increaseSYNFlood(synFloodConfig) } else if err == nil && !this.hasResetSYNFlood { this.hasResetSYNFlood = true this.resetSYNFlood() } - } else if isHandshakeError { - _ = this.SetLinger(0) } return