}
while(B.get(rr)) {
if (haveCNAME) {
- continue;
+ // No need to look any further
+ B.lookupEnd();
+ break;
}
#ifdef HAVE_LUA_RECORDS
if (rr.dr.d_type == QType::LUA && !isPresigned()) {
DNSZoneRecord rr;
while( closest.chopOff() && (closest != d_sd.qname())) { // stop at SOA
B.lookup(QType(QType::ANY), closest, d_sd.domain_id, &p);
- while(B.get(rr))
- if (rr.auth)
+ while (B.get(rr)) {
+ if (rr.auth) {
+ B.lookupEnd();
doBreak = true;
+ break;
+ }
+ }
if(doBreak)
break;
}
}
// Safe to pass UnknownDomainID here
B.lookup(QType(QType::A), DNSName(std::to_string(dns_random_uint32()))+domain, UnknownDomainID);
- while(B.get(rr)) {
- }
+ B.lookupEnd();
misses++;
}
bool ns=false;
DNSZoneRecord zr;
B.lookup(QType(QType::ANY), zone.operator const DNSName&(), sd_p.domain_id);
- while(B.get(zr))
- ns |= (zr.dr.d_type == QType::NS);
+ while(B.get(zr)) {
+ if (zr.dr.d_type == QType::NS) {
+ ns = true;
+ B.lookupEnd();
+ break;
+ }
+ }
if (!ns) {
cout<<"[Error] No delegation for zone '"<<zone<<"' in parent '"<<parent<<"'"<<endl;
numerrors++;
}
}
reject = true;
+ di.backend->lookupEnd();
+ break;
}
if (reject) {
cerr<<"Attempting to add CNAME to "<<rr.qname<<" which already has existing records"<<endl;
}
else {
di.backend->lookup(QType(QType::CNAME), rr.qname, static_cast<int>(di.id));
- // TODO: It would be nice to have a way to complete a lookup and release its
- // resources without having to exhaust its results - here one successful
- // get() is all we need to decide to reject the operation. I'm looking at
- // you, lmdb backend.
while (di.backend->get(oldrr)) {
reject = true;
+ di.backend->lookupEnd();
+ break;
}
if (reject) {
cerr<<"Attempting to add record to "<<rr.qname<<" which already has a CNAME record"<<endl;