miekg / exdns

Go DNS example programs
BSD 2-Clause "Simplified" License
300 stars 60 forks source link

q.go handle the Truncated can be better #3

Open NewRegin opened 8 years ago

NewRegin commented 8 years ago

in q.go(line 347 and below), if the err is dns.ErrTruncated will end this search and continue the next one, but we want't this happen, so we can solve the problem of Truncated by the follow way:

//line [347] ....... switch e { ............... case nil: ............... ............//do nothing ............... case dns.ErrTruncated: ............... ............if *fallback { ............... ............... goto Redo ............... ............} else { ............... ............... .....goto Redo ............... ............} ........................fmt.Printf(";; Truncated\n") ............... default: ............... ........fmt.Printf(";; %s\n", e.Error()) ............... ........continue ..............}

miekg commented 8 years ago

Ack, can you rework this into a PR?

NewRegin commented 8 years ago

my honor~