Commit Graph

8 Commits

Author SHA1 Message Date
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
Miek Gieben e7c3f513a1
Remove compression from AFSDB (#704)
This type should not compress its rdata.

Fixes #521
2018-06-23 09:43:19 +01: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 fbee4ceea9
Lint: use ignore-this on generated files (#596)
Make golint not complain about generated file - it's a bit of cheating,
but I think that is OK.
2017-12-06 10:02:47 +00:00
andrewtj 145266a717 Make compress generate output stable and edns.go formatting (#542)
* make compress_generate.go produce stable output

* go fmt edns.go
2017-11-03 14:41:20 +00:00
Miek Gieben 767422ac12 Add AVC record (#480)
See
https://www.iana.org/assignments/dns-parameters/AVC/avc-completed-template
for the template, a new record that is (again) a mirror of the TXT
record. For lack of a better name, name the rdata Txt - as we do in SPF
and TXT.
2017-03-29 22:17:13 +02:00
Miek Gieben 01a32dc202 Re-gen zcompress.go (#461)
and add one golint/doc fix intoit.
2017-02-17 11:59:01 +00:00
Miek Gieben 74ec3b2433 Generate the compressionHelper functions (#454)
* Generate the compressionHelper functions and fix compression.

This was a long standing TODO: generate the compression helper
functions. This now automatically picks up new names that can be
used for compression.

When packing add names to compression map:

When packing a message we should only compress when compress is true.
But whenever the compression map is not nil we should still add names
to it that can be *used* for future compression. The packing
inadvertently only added those names when compress would be true.

* Removed unused functions
2017-02-17 09:48:37 +00:00