DNSResourceRecord rec;
while (get(rec)) {
if (maxResults == 0) {
- continue;
+ // No need to look any further
+ lookupEnd();
+ break;
}
if (simpleMatch.match(rec.qname) || simpleMatch.match(rec.content)) {
result.emplace_back(rec);
}
}
catch (...) {
- while (this->get(resourceRecord)) {
- ;
- }
+ this->lookupEnd();
throw;
}
while(di->backend->get(rec)) {
if (!rec.qtype.getCode())
continue;
- if ((rr->d_type != QType::ANY && rec.qtype == rr->d_type) || rr->d_type == QType::ANY)
+ if ((rr->d_type != QType::ANY && rec.qtype == rr->d_type) || rr->d_type == QType::ANY) {
foundRecord=true;
+ di->backend->lookupEnd();
+ break;
+ }
}
// Section 3.2.1
while (di.backend->get(rec)) {
if (rec.qtype != QType::CNAME && rec.qtype != QType::ENT && rec.qtype != QType::RRSIG) {
// leave database handle in a consistent state
- while (di.backend->get(rec))
- ;
+ di.backend->lookupEnd();
g_log<<Logger::Warning<<msgPrefix<<"Refusing update for " << rr->d_name << "/" << QType(rr->d_type).toString() << ": Data other than CNAME exists for the same name"<<endl;
di.backend->abortTransaction();
return RCode::Refused;
while (di.backend->get(rec)) {
if (rec.qtype == QType::CNAME && rr->d_type != QType::RRSIG) {
// leave database handle in a consistent state
- while (di.backend->get(rec))
- ;
+ di.backend->lookupEnd();
g_log<<Logger::Warning<<msgPrefix<<"Refusing update for " << rr->d_name << "/" << QType(rr->d_type).toString() << ": CNAME exists for the same name"<<endl;
di.backend->abortTransaction();
return RCode::Refused;
|| exclusiveEntryTypes.count(resourceRecord.qtype.getCode()) != 0)) {
// leave database handle in a consistent state
- while (domainInfo.backend->get(resourceRecord)) {
- ;
- }
+ domainInfo.backend->lookupEnd();
throw ApiException("RRset " + qname.toString() + " IN " + qtype.toString() + ": Conflicts with pre-existing RRset");
}