mirror of https://github.com/golang/go.git
net: improve GODEBUG=netdns=1 debug messages
Fixes #69680
Change-Id: I73b0506c7a3245ba282cffabe47543f5fce86692
GitHub-Last-Rev: 4c6a1a4c70
GitHub-Pull-Request: golang/go#69684
Reviewed-on: https://go-review.googlesource.com/c/go/+/616263
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
0fb33863b7
commit
6536c207c2
|
|
@ -93,20 +93,31 @@ func initConfVal() {
|
|||
if confVal.dnsDebugLevel > 1 {
|
||||
println("go package net: confVal.netCgo =", confVal.netCgo, " netGo =", confVal.netGo)
|
||||
}
|
||||
switch {
|
||||
case confVal.netGo:
|
||||
if netGoBuildTag {
|
||||
println("go package net: built with netgo build tag; using Go's DNS resolver")
|
||||
} else {
|
||||
println("go package net: GODEBUG setting forcing use of Go's resolver")
|
||||
if dnsMode != "go" && dnsMode != "cgo" && dnsMode != "" {
|
||||
println("go package net: GODEBUG=netdns contains an invalid dns mode, ignoring it")
|
||||
}
|
||||
switch {
|
||||
case netGoBuildTag || !cgoAvailable:
|
||||
if dnsMode == "cgo" {
|
||||
println("go package net: ignoring GODEBUG=netdns=cgo as the binary was compiled without support for the cgo resolver")
|
||||
} else {
|
||||
println("go package net: using the Go DNS resolver")
|
||||
}
|
||||
case netCgoBuildTag:
|
||||
if dnsMode == "go" {
|
||||
println("go package net: GODEBUG setting forcing use of the Go resolver")
|
||||
} else {
|
||||
println("go package net: using the cgo DNS resolver")
|
||||
}
|
||||
case !cgoAvailable:
|
||||
println("go package net: cgo resolver not supported; using Go's DNS resolver")
|
||||
case confVal.netCgo || confVal.preferCgo:
|
||||
println("go package net: using cgo DNS resolver")
|
||||
default:
|
||||
if dnsMode == "go" {
|
||||
println("go package net: GODEBUG setting forcing use of the Go resolver")
|
||||
} else if dnsMode == "cgo" {
|
||||
println("go package net: GODEBUG setting forcing use of the cgo resolver")
|
||||
} else {
|
||||
println("go package net: dynamic selection of DNS resolver")
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue