Update system_dialer.go

pull/4927/head
xqzr 2025-07-25 00:10:36 +08:00 committed by GitHub
parent 4f45c5faa5
commit 99b9dc2460
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 5 deletions

View File

@ -87,14 +87,10 @@ func (d *DefaultSystemDialer) Dial(ctx context.Context, src net.Address, dest ne
Dest: destAddr,
}, nil
}
goStdKeepAlive := time.Duration(0)
if sockopt != nil && (sockopt.TcpKeepAliveInterval != 0 || sockopt.TcpKeepAliveIdle != 0) {
goStdKeepAlive = time.Duration(-1)
}
dialer := &net.Dialer{
Timeout: time.Second * 16,
LocalAddr: resolveSrcAddr(dest.Network, src),
KeepAlive: goStdKeepAlive,
KeepAlive: time.Duration(-1),
}
if sockopt != nil || len(d.controllers) > 0 {