getdnsapi / getdns

A modern asynchronous DNS API https://getdnsapi.net/
Other
461 stars 127 forks source link

Fixes #495 (and #505) by implementing name compression in DNS responses #508

Closed amialkow closed 3 years ago

amialkow commented 3 years ago

495 Implement name compression during response packet generation. Compression is required by certain clients like UDP to fit response in packet size limit. While generating packet small cache stores recently used names (currently 4 entries) and uses relative references to previous instances of the same name. Each reused instance is just two bytes of relative reference (0xC000 + offset). Cache is currently performing lookup for query name, responses and CNAMEs.

505 Disable comparison of packet size in 265-supported-rrs test, after #495 output packet size depends on applied compression.

wtoorop commented 3 years ago

Thanks @amialkow for you thorough (and straight forward and easy to understand) implementation! I love it!