1
0
Fork 0
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:
Santhosh Manohar 2016-07-23 02:56:31 -07:00
parent 5fee2c5be9
commit b2603e895a

View file

@ -474,6 +474,11 @@ func (r *resolver) ServeDNS(w dns.ResponseWriter, query *dns.Msg) {
// read again
resp, err = co.ReadMsg()
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() {
r.addQueryToGC(w, query)
}