Fix: TCP dial error should not return early (#307)

This commit is contained in:
gVisor bot 2019-09-17 20:11:49 +08:00
parent b38663a209
commit 5b76ff53c9

View file

@ -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()