From 146152170fc2fbd5aa3e17c505f0ed9562f5badc Mon Sep 17 00:00:00 2001
From: Pierre Souchay
Date: Tue, 17 Apr 2018 01:10:52 +0200
Subject: [PATCH] Added comment for function dnsBinaryTruncate
---
agent/dns.go | 2 ++
1 file changed, 2 insertions(+)
diff --git a/agent/dns.go b/agent/dns.go
index e5abb05fb..9e3b5216e 100644
--- a/agent/dns.go
+++ b/agent/dns.go
@@ -717,6 +717,8 @@ func syncExtra(index map[string]dns.RR, resp *dns.Msg) {
resp.Extra = extra
}
+// dnsBinaryTruncate find the optimal number of records using a fast binary search and return
+// it in order to return a DNS answer lower than maxSize parameter.
func dnsBinaryTruncate(resp *dns.Msg, maxSize int, index map[string]dns.RR, hasExtra bool) int {
originalAnswser := resp.Answer
startIndex := 0