Remove dns.ErrTruncated according to https://github.com/miekg/dns/pull/815

This commit is contained in:
Star Brilliant
2018-11-28 15:31:02 +08:00
parent 01d60df9cd
commit fa2bcf74a9
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -273,7 +273,7 @@ func (c *Client) handlerFunc(w dns.ResponseWriter, r *dns.Msg, isTCP bool) {
} else {
reply, _, err = c.tcpClient.Exchange(r, upstream)
}
if err == nil || err == dns.ErrTruncated {
if err == nil {
w.WriteMsg(reply)
return
}
+1 -1
View File
@@ -205,7 +205,7 @@ func (c *Client) parseResponseIETF(ctx context.Context, w dns.ResponseWriter, r
fullReply := new(dns.Msg)
err = fullReply.Unpack(body)
if err != nil && err != dns.ErrTruncated {
if err != nil {
log.Println(err)
req.reply.Rcode = dns.RcodeServerFailure
w.WriteMsg(req.reply)