Added comment for function dnsBinaryTruncate

This commit is contained in:
Pierre Souchay 2018-04-17 01:10:52 +02:00
parent 94c0bf978a
commit c838376dfa
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