mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 11:42:43 +08:00
Fix: TCP dial error should not return early (#307)
This commit is contained in:
parent
b76737bdbb
commit
8adcc4d83b
|
@ -140,12 +140,9 @@ func dialTimeout(network, address string, timeout time.Duration) (net.Conn, erro
|
|||
} else {
|
||||
c, err = dialer.DialContext(ctx, "tcp4", net.JoinHostPort(ip.String(), port))
|
||||
}
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
select {
|
||||
case results <- dialResult{Conn: c, error: err, ipv6: ipv6}:
|
||||
case results <- dialResult{Conn: c, error: err, ipv6: ipv6, done: true}:
|
||||
case <-returned:
|
||||
if c != nil {
|
||||
c.Close()
|
||||
|
|
Loading…
Reference in New Issue
Block a user