HomePhabricator

Simplify max query name length check in parse_name()

Description

Simplify max query name length check in parse_name()

Summary:
Rather than having two redundent checks in two different places, having
one simplier check in one place is easier to maintain and makes the
return site consistent.

Also adjusts the unit test to reflect this change. Before the change, the behavior would appear to be correct, however, the function would return an error because of the label length rather than erroring because of the length of the entire qname.

Test Plan:

ninja check-bitcoin-seeder

Reviewers: O1 Bitcoin ABC, #bitcoin_abc, jasonbcox

Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, jasonbcox

Subscribers: jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D5466

Details

Provenance
nakihitoAuthored on Mar 11 2020, 23:14
nakihitoPushed on Mar 12 2020, 00:42
Reviewer
Restricted Owners Package
Differential Revision
D5466: Simplify max query name length check in parse_name()
Parents
rABCa2d246707a8b: Update package name in debian/control to bitcoinabc
Branches
Unknown
Tags
Unknown