Commit Graph

9 Commits

Author SHA1 Message Date
chantra ee8fef6743
Update Truncate doc with compress behaviour (#1217)
* 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
2021-02-10 07:41:26 +01:00
Miek Gieben ef286f8f39
Update doc for Truncate (#1173)
Follow up after #1171, update the docs about TC and use the MinMsgSize
constant for 512 in the code.

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-10-14 08:42:57 +02:00
Chris O'Haver 5579226123
dont unset TC on a message that is already truncated (#1171)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2020-10-14 07:18:59 +02:00
Florian Lehner 7963800469
l is never used (#1071)
Signed-off-by: Lehner Florian <dev@der-flo.net>
2020-02-03 21:10:40 +01:00
Miek Gieben 93f749db12
Revert "pool the transient maps used for Msg Pack, Truncate and Len (#1006)" (#1017)
This reverts #1006, see discussion on the PR. Def. worth exploring this
furhter and pushing a more correct approach.

This reverts commit 9578caeab0.
2019-10-03 07:36:27 +01:00
Charlie Vieth 9578caeab0 pool the transient maps used for Msg Pack, Truncate and Len (#1006)
This improves runtime by 20-40% and more importantly significantly
reduces memory usage and allocations.
2019-09-23 07:16:26 +01:00
Tom Thorogood 7f2bf8764a Set the TC bit more aggressively in Truncate (#989)
* Set the TC bit more aggressively in Truncate

* Update Truncate documentation for TC bit changes
2019-06-24 16:59:43 +01:00
Miek Gieben 59b8e6b3db
Remove the word Scrub (#961)
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>
2019-05-03 08:25:00 +01:00
Tom Thorogood d051b464e9 Add a message truncation implementation (#854)
* 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
2019-03-24 09:20:11 +00:00