Try to compress too long replies (when forwarding).

This commit is contained in:
Alvaro Saurin committed 2015-08-17 18:50:16 +02:00
1 parent d220542491
commit c50c90ea8d
2 files changed
+23 -5

No files matched your search

+3
View File
@@ -395,6 +395,9 @@ func (s *DNSServer) notUsHandler(proto dnsProtocol) dns.HandlerFunc {
}
Debug.Printf("[dns msgid %d] Given answer by %s for query %s",
r.MsgHdr.Id, server, q.Name)
if reply.Len() > maxLen {
reply.Compress = true
}
w.WriteMsg(reply)
return
}