aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikio Hara <mikioh.mikioh@gmail.com>2013-12-19 10:00:15 +0900
committerMikio Hara <mikioh.mikioh@gmail.com>2013-12-19 10:00:15 +0900
commit7eb45d3c4a0956fc2207001360472ad048e544bc (patch)
treeb1ede94c5309d000129dbf7852045b2892c8b6af /src
parentb682f6de5a9d645a92792e2ffad1956c64b7840f (diff)
downloadgo-7eb45d3c4a0956fc2207001360472ad048e544bc.tar.xz
net: don't return a nested error when happy eyeballs dialing
Also removes an unused variable. Fixes #6795. R=adg, dave, bradfitz, gobot CC=golang-dev https://golang.org/cl/29440043
Diffstat (limited to 'src')
-rw-r--r--src/pkg/net/dial.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/pkg/net/dial.go b/src/pkg/net/dial.go
index 6304818bf1..70b66e70d1 100644
--- a/src/pkg/net/dial.go
+++ b/src/pkg/net/dial.go
@@ -172,7 +172,6 @@ func (d *Dialer) Dial(network, address string) (Conn, error) {
func dialMulti(net, addr string, la Addr, ras addrList, deadline time.Time) (Conn, error) {
type racer struct {
Conn
- Addr
error
}
// Sig controls the flow of dial results on lane. It passes a
@@ -184,7 +183,7 @@ func dialMulti(net, addr string, la Addr, ras addrList, deadline time.Time) (Con
go func(ra Addr) {
c, err := dialSingle(net, addr, la, ra, deadline)
if _, ok := <-sig; ok {
- lane <- racer{c, ra, err}
+ lane <- racer{c, err}
} else if err == nil {
// We have to return the resources
// that belong to the other
@@ -195,7 +194,6 @@ func dialMulti(net, addr string, la Addr, ras addrList, deadline time.Time) (Con
}(ra.toAddr())
}
defer close(sig)
- var failAddr Addr
lastErr := errTimeout
nracers := len(ras)
for nracers > 0 {
@@ -205,12 +203,11 @@ func dialMulti(net, addr string, la Addr, ras addrList, deadline time.Time) (Con
if racer.error == nil {
return racer.Conn, nil
}
- failAddr = racer.Addr
lastErr = racer.error
nracers--
}
}
- return nil, &OpError{Op: "dial", Net: net, Addr: failAddr, Err: lastErr}
+ return nil, lastErr
}
// dialSingle attempts to establish and returns a single connection to