mirror of
https://github.com/miekg/dns.git
synced 2025-12-16 09:11:34 +01:00
snapshot
This commit is contained in:
parent
5cf4522eed
commit
51e13a15c9
@ -537,11 +537,16 @@ func (w *reply) writeClient(p []byte) (n int, err error) {
|
|||||||
i += j
|
i += j
|
||||||
}
|
}
|
||||||
n = i
|
n = i
|
||||||
|
// TODO(mg): is the loop correct?
|
||||||
}
|
}
|
||||||
case "", "udp", "udp4", "udp6":
|
case "", "udp", "udp4", "udp6":
|
||||||
for a := 0; a < attempts; a++ {
|
for a := 0; a < attempts; a++ {
|
||||||
|
println("DOING", a)
|
||||||
setTimeouts(w)
|
setTimeouts(w)
|
||||||
n, err = w.conn.(*net.UDPConn).Write(p)
|
n, err = w.conn.(*net.UDPConn).Write(p)
|
||||||
|
if err == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if e, ok := err.(net.Error); ok && e.Timeout() {
|
if e, ok := err.(net.Error); ok && e.Timeout() {
|
||||||
continue
|
continue
|
||||||
|
|||||||
@ -31,6 +31,7 @@ func serve(w dns.ResponseWriter, r *dns.Msg, c *Cache) {
|
|||||||
c.Insert(p)
|
c.Insert(p)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
log.Printf("fks-shield: failed to get answer " + e.Error())
|
||||||
// w.Write(SERFVAIL)
|
// w.Write(SERFVAIL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user