getdnsapi / getdns

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

Fixes #495. Implement name compression in DNS response packet generation. #503

Closed amialkow closed 3 years ago

amialkow commented 3 years ago

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.

amialkow commented 3 years ago

Tree compilation nee to be fixed first to pull this feature, already started in #504. Closing for now. Will submit separately as standalone change (#495 and #505).