Set defaults to the same values as various C DNS resolver libraries.
Use the timeout value from the configuration.
Fixes #632.
R=rsc
CC=golang-dev
https://golang.org/cl/223094
return nil, err
}
- c.SetReadTimeout(1e9) // nanoseconds
+ c.SetReadTimeout(int64(cfg.timeout) * 1e9) // nanoseconds
buf := make([]byte, 2000) // More than enough.
n, err = c.Read(buf)
conf.servers = make([]string, 3)[0:0] // small, but the standard limit
conf.search = make([]string, 0)
conf.ndots = 1
- conf.timeout = 1
- conf.attempts = 1
+ conf.timeout = 5
+ conf.attempts = 2
conf.rotate = false
for line, ok := file.readLine(); ok; line, ok = file.readLine() {
f := getFields(line)