调整关闭连接后的Linger值

This commit is contained in:
刘祥超
2023-07-25 09:36:45 +08:00
parent b6a2bd37b1
commit 959e274063

View File

@@ -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检测