]> Cypherpunks repositories - gostls13.git/commit
net: use Go's DNS resolver when system configuration permits
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 16 Apr 2015 21:33:25 +0000 (14:33 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 23 Apr 2015 02:48:43 +0000 (02:48 +0000)
commit4a0ba7aa171a80fe798811a3fdc7c42b83dcda01
treeb3b0e1c2f4eafbfe92e64a0df5eed11aae8d7e5b
parentc23122808577dca6315f3fc3b6cc4ef67e877080
net: use Go's DNS resolver when system configuration permits

If the machine's network configuration files (resolv.conf,
nsswitch.conf) don't have any unsupported options, prefer Go's DNS
resolver, which doesn't have the cgo & thread over.

It means users can have more than 500 DNS requests outstanding (our
current limit for cgo lookups) and not have one blocked thread per
outstanding request.

Discussed in thread https://groups.google.com/d/msg/golang-dev/2ZUi792oztM/Q0rg_DkF5HMJ

Change-Id: I3f685d70aff6b47bec30b63e9fba674b20507f95
Reviewed-on: https://go-review.googlesource.com/8945
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
src/net/conf.go [new file with mode: 0644]
src/net/conf_test.go [new file with mode: 0644]
src/net/dnsclient_unix.go
src/net/dnsconfig_unix.go
src/net/dnsconfig_unix_test.go
src/net/lookup_unix.go
src/net/nss.go [new file with mode: 0644]
src/net/nss_test.go [new file with mode: 0644]
src/net/parse.go
src/net/testdata/openbsd-resolv.conf [new file with mode: 0644]