]> Cypherpunks repositories - gostls13.git/commit
net: make go resolver aware of network parameter
authorZhang Boyang <zhangboyang.id@gmail.com>
Mon, 15 Mar 2021 15:27:51 +0000 (15:27 +0000)
committerEmmanuel Odeke <emmanuel@orijtech.com>
Tue, 23 Mar 2021 11:14:58 +0000 (11:14 +0000)
commit53dd0d78098a43cbca26d6807fea3d58aec64ef7
tree2a5bda55b6d3db13d381e0833d3c5f75ff94ff55
parentf4b918384d64dbd046f144012a60080fae16af86
net: make go resolver aware of network parameter

Currently, the go resolver always send two DNS queries (A and AAAA) even
if tcp4/udp4/ip4 or tcp6/udp6/ip6 is used. This can cause unwanted
latencies when making IPv4-only or IPv6-only connections.

This change make go resolver aware of network parameter. Now, only one A
query is sent when tcp4/udp4/ip4 is used, and vice versa for
tcp6/udp6/ip6.

Fixes #45024

Change-Id: I815f909e6df5f7242cfc900f7dfecca628c3a2c8
GitHub-Last-Rev: 3d30c486dedd0d211366b1989034480a22ef2ffc
GitHub-Pull-Request: golang/go#45016
Reviewed-on: https://go-review.googlesource.com/c/go/+/301709
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
src/net/dnsclient_unix.go
src/net/dnsclient_unix_test.go
src/net/lookup_unix.go
src/net/netgo_unix_test.go