Added comment for function dnsBinaryTruncate

This commit is contained in:
Pierre Souchay 2018-04-17 01:10:52 +02:00
parent 9a819b5b29
commit 146152170f
1 changed files with 2 additions and 0 deletions

View File

@ -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