Compress recursive answers if they are too big.

This commit is contained in:
Tom Wilkie authored and Matthias Radestock committed 2015-08-17 18:25:26 +01:00
1 parent 74e29c8990
commit 4f00dab4c4
1 file changed
+3
+3
View File
@@ -239,6 +239,9 @@ func (d *DNSServer) handleRecursive(client *dns.Client, defaultMaxResponseSize i
}
d.ns.debugf("response: %+v", response)
response.Id = req.Id
if response.Len() > getMaxResponseSize(req, defaultMaxResponseSize) {
response.Compress = true
}
if err := w.WriteMsg(response); err != nil {
d.ns.infof("error responding: %v", err)
}