From 959e2740631574e94061c33424ca5f95b2fa2cdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Tue, 25 Jul 2023 09:36:45 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=85=B3=E9=97=AD=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E5=90=8E=E7=9A=84Linger=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/client_conn.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/nodes/client_conn.go b/internal/nodes/client_conn.go index 88a844c..c25834b 100644 --- a/internal/nodes/client_conn.go +++ b/internal/nodes/client_conn.go @@ -130,6 +130,10 @@ func (this *ClientConn) Read(b []byte) (n int, err error) { var isTimeout = err != nil && os.IsTimeout(err) var isHandshakeError = isTimeout && !this.hasRead + if err != nil { + _ = this.SetLinger(nodeconfigs.DefaultTCPLinger) + } + // 忽略白名单和局域网 if !this.isPersistent && this.isHTTP && !this.isInAllowList && !utils.IsLocalIP(this.RawIP()) { // SYN Flood检测