Commit Graph

8 Commits

Author SHA1 Message Date
Tom Thorogood 56118562d7
Fix typo in TestMsgCompressLengthEscapingMatch comment 2018-11-29 09:58:18 +10:30
Tom Thorogood d27f0d3482
Add a test case to cover escaping in the compression map 2018-11-29 09:53:00 +10:30
Tom Thorogood 7ae05cdcf8
Use map[string]struct{} for compression map in Len (#820)
* Use map[string]struct{} for compression map in Len

map[string]int requires 8 bytes per entry to store the unused position
information.

* Add MsgLength benchmark with more RRs
2018-11-28 08:02:08 +10:30
Tom Thorogood e2f69345fd Avoid creating compression map for question only Msg (#823)
* Pass dns.Compress explicitly to packBufferWithCompressionMap

* Avoid creating compression map for question only Msg

This idea was inspired by:
  "Skip dname compression for replies with no answers."
 https://www.nlnetlabs.nl/bugs-script/show_bug.cgi?id=235

* Continue compressing multiple questions
2018-11-27 14:34:07 +00:00
Tom Thorogood 8eab0120c4 Use FQDN for question in TestCompressLength (#831)
This was a bug.
2018-11-27 14:28:13 +00:00
Tom Thorogood e969cef252 Use t.Errorf not panic in TestCompressionLenSearch (#832) 2018-11-27 14:26:34 +00:00
Pierre Souchay 09649115c1 Fixed len computation when size just goes beyond 14 bits (#668)
* Fixed len computation when size just goes beyond 14 bits

* Added bouds checks around 14bits

* Len() always right including when around 14bits boudaries

* Avoid splitting into labels when not applicable

* Fixed comments

* Added comments in code

* Added new test cases

* Fixed computation of Len() for SRV and all kind of records

* Fixed Sign that was relying on non-copy for Unit tests

* Removed unused padding

* Fixed typo in PackBuffer() function

* Added comment about packBufferWithCompressionMap() for testing purposes
2018-05-16 07:20:13 +01:00
Miek Gieben dfb943b13e
Take the max compression offset into account in Len(). (#658)
This offset max was not taking into account leading Len() to emit a
smaller value that could not be matched by Pack(), i.e all names can
be fully compressed or used as a target for compression.

Split length tests off in seperate file length_test.go to clean up
dns_test.og a bit.
2018-04-01 09:45:32 +01:00