* 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
The function is called Truncate, not Scrub (that was the old name).
Updated the function's documentation to rename this.
Signed-off-by: Miek Gieben <miek@miek.nl>
* Add a message truncation implementation
* Remove OPT if-statement at end of Scrub
* Impose RFC 6891 payload size limit in Scrub
* Remove *Msg receiver from truncateLoop
* Remove OPT record creation from Scrub
* Test that TestRequestScrubAnswerExact has correct record count
* Rename (*Msg).Scrub to Truncate
This better reflects it's purpose.
* Remove comment reference to scrubbing in Truncate
* Properly calculate the length of OPT record in Truncate
* Correct comment in IsEdns0 in regards to RFC 6891
* Handle the OPT record being anywhere in Truncate
* Slight cleanup of Msg.Truncate