]> git.ipfire.org Git - thirdparty/bind9.git/commit
Use hashtable when parsing a message
authorOndřej Surý <ondrej@isc.org>
Mon, 11 Sep 2023 08:35:28 +0000 (10:35 +0200)
committerMichał Kępień <michal@isc.org>
Thu, 22 Feb 2024 11:00:47 +0000 (12:00 +0100)
commit0ceed03ebea395da1a39ad1cb39205ce75a3f768
treeae055f5b0ef13bc2e0b1893ec2c844d6cf4b14bf
parentcb24cbf13513913d23bbebc89b71a9dce80ea846
Use hashtable when parsing a message

When parsing messages use a hashtable instead of a linear search to reduce
the amount of work done in findname when there's more than one name in
the section.

There are two hashtables:

1) hashtable for owner names - that's constructed for each section when we
hit the second name in the section and destroyed right after parsing
that section;

2) per-name hashtable - for each name in the section, we construct a new
hashtable for that name if there are more than one rdataset for that
particular name.

(cherry picked from commit b8a96317544c7b310b4f74360825a87b6402ddc2)
lib/dns/include/dns/message.h
lib/dns/include/dns/name.h
lib/dns/message.c
lib/dns/name.c