]> Cypherpunks repositories - gostls13.git/commit
net: use dialTCP cancelation for DualStack dialing.
authorPaul Marks <pmarks@google.com>
Tue, 9 Feb 2016 04:25:38 +0000 (20:25 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 23 Feb 2016 19:26:34 +0000 (19:26 +0000)
commit676550d040fcd91d080df5df85b61b3f32393e6f
tree9de4a62af11080d61321cd10bb38a4b4cb77da07
parent5583e8a4213467d3401710873f67403cb2de22f7
net: use dialTCP cancelation for DualStack dialing.

The previous Happy Eyeballs implementation would intentionally leak
connections, because dialTCP could not be reliably terminated upon
losing the race.

Now that dialTCP supports cancelation (plan9 excluded), dialParallel can
wait for responses from both the primary and fallback racers, strictly
before returning control to the caller.

In dial_test.go, we no longer need Sleep to avoid leaks.
Also, fix a typo in the Benchmark IPv4 address.

Updates #11225
Fixes #14279

Change-Id: Ibf3fe5c7ac2f7a438c1ab2cdb57032beb8bc27b5
Reviewed-on: https://go-review.googlesource.com/19390
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/dial.go
src/net/dial_test.go