]> git.ipfire.org Git - thirdparty/pdns.git/commit
Simplify some DNSName label processing.
authorMiod Vallat <miod.vallat@powerdns.com>
Fri, 25 Jul 2025 07:05:25 +0000 (09:05 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Fri, 25 Jul 2025 12:17:22 +0000 (14:17 +0200)
commit65105e6555db1f8131ec5fc33d4a4c44ca1c94d2
tree2330bdd9c0c29c4b8cfb50147a7c9e366c371981
parent8d8260a9a9e076f3bf62e5eabde076cd1a429cf2
Simplify some DNSName label processing.

Instead of checking countLabels() against zero, introduce a faster
hasLabels() which does not need to actually count them.

Also replace getRawLabels()[n] with getRawLabel(n), the only difference
being that getRawLabel() will raise an exception if n is out of bounds,
instead of returning garbage.

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
pdns/dnsname.hh
pdns/dnssecsigner.cc
pdns/packethandler.cc
pdns/pdnsutil.cc
pdns/validate.cc