mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Send truncated external responses to the client
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
This commit is contained in:
parent
5fee2c5be9
commit
b2603e895a
1 changed files with 5 additions and 0 deletions
|
@ -474,6 +474,11 @@ func (r *resolver) ServeDNS(w dns.ResponseWriter, query *dns.Msg) {
|
||||||
// read again
|
// read again
|
||||||
resp, err = co.ReadMsg()
|
resp, err = co.ReadMsg()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// Truncated DNS replies should be sent to the client so that the
|
||||||
|
// client can retry over TCP
|
||||||
|
if err == dns.ErrTruncated && resp != nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
if nerr, ok := err.(net.Error); ok && nerr.Timeout() {
|
if nerr, ok := err.(net.Error); ok && nerr.Timeout() {
|
||||||
r.addQueryToGC(w, query)
|
r.addQueryToGC(w, query)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue