From: Miod Vallat Date: Mon, 30 Jun 2025 10:11:10 +0000 (+0200) Subject: Factor trailing code of getBeforeAndAfterNamesAbsolute(). NFCI X-Git-Tag: rec-5.3.0-alpha2~29^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=032c98dfd98fe7e7f097a2ae387782987bc572bf;p=thirdparty%2Fpdns.git Factor trailing code of getBeforeAndAfterNamesAbsolute(). NFCI Signed-off-by: Miod Vallat --- diff --git a/modules/lmdbbackend/lmdbbackend.cc b/modules/lmdbbackend/lmdbbackend.cc index b714656463..6ef36a4495 100644 --- a/modules/lmdbbackend/lmdbbackend.cc +++ b/modules/lmdbbackend/lmdbbackend.cc @@ -2336,7 +2336,30 @@ bool LMDBBackend::isNSEC3BackRecord(LMDBResourceRecord& lrr, const MDBOutVal& ke return false; } -// NOLINTNEXTLINE(readability-function-cognitive-complexity,readability-identifier-length) +// Search for the next NSEC3 back record and return its qname as `after'. +// Returns true if found, false if not (either end of database records, or +// different domain). +bool LMDBBackend::getAfterForward(MDBROCursor& cursor, MDBOutVal& key, MDBOutVal& val, domainid_t id, DNSName& after) +{ + compoundOrdername co; // NOLINT(readability-identifier-length) + LMDBResourceRecord lrr; + + if (cursor.lower_bound(co(id), key, val) != 0) { + // cout<<"hit end of zone find when we shouldn't"<()) != id) { + // cout<<"hit end of zone or database when we shouldn't"<()); + // cout<<"returning: before="<()) != id) { - // cout<<"hit end of zone or database when we shouldn't"<()); - // cout<<"returning: before="<()) <()) != id) { - // cout<<"hit end of zone or database when we shouldn't" << __LINE__<()); - // cout<<"returning: before="<()); - - // cout<<"returning: before="<()) != id) { // cout <<"Hit end of database or zone, finding first hash then in zone "<()); - - // cout<<"returning: before="<()) <