Skip to content

Commit

Permalink
Update Truncate doc with compress behaviour (#1217)
Browse files Browse the repository at this point in the history
* Update Truncate doc with compress behaviour

This is a documentation update to highlight the behaviour of Truncate, which will reset dns.Compress to false when the message fits in the requested size without truncation, and make it the caller responsibility to set it back to true if they wish to compress, regardless of fitting, uncompressed, in the requested message size in the first place or not.
Fixes #1216

* address comments

* d/Note that/
* s/reset/set/
* s/caller/caller's/
* removed backticks

* regardless of size
  • Loading branch information
chantra authored Feb 10, 2021
1 parent 35023fa commit ee8fef6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions msg_truncate.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ package dns
// record adding as many records as possible without exceeding the
// requested buffer size.
//
// If the message fits within the requested size without compression,
// Truncate will set the message's Compress attribute to false. It is
// the caller's responsibility to set it back to true if they wish to
// compress the payload regardless of size.
//
// The TC bit will be set if any records were excluded from the message.
// If the TC bit is already set on the message it will be retained.
// TC indicates that the client should retry over TCP.
Expand Down

0 comments on commit ee8fef6

Please sign in to comment.