This commit is contained in:
Miek Gieben 2012-08-05 18:13:23 +02:00
parent 5cf4522eed
commit 51e13a15c9
3 changed files with 7 additions and 0 deletions

View File

@ -537,11 +537,16 @@ func (w *reply) writeClient(p []byte) (n int, err error) {
i += j
}
n = i
// TODO(mg): is the loop correct?
}
case "", "udp", "udp4", "udp6":
for a := 0; a < attempts; a++ {
println("DOING", a)
setTimeouts(w)
n, err = w.conn.(*net.UDPConn).Write(p)
if err == nil {
return
}
if err != nil {
if e, ok := err.(net.Error); ok && e.Timeout() {
continue

View File

@ -31,6 +31,7 @@ func serve(w dns.ResponseWriter, r *dns.Msg, c *Cache) {
c.Insert(p)
return
} else {
log.Printf("fks-shield: failed to get answer " + e.Error())
// w.Write(SERFVAIL)
}
}

View File

@ -157,6 +157,7 @@ Flags:
c.Net = "udp6"
}
}
c.Attempts = 6
m := new(dns.Msg)
m.MsgHdr.Authoritative = *aa