After the initial lookup corresponding to a `DNSBackend::getAuth()`,
the subsequent ones already have the `zoneId`, so use it instead of
looping on `chopOff()` again. This should be much more efficient.
bool found=false;
BB2DomainInfo bbd;
- do {
- found = safeGetBBDomainInfo(domain, &bbd);
- } while ((!found || (zoneId != (int)bbd.d_id && zoneId != -1)) && domain.chopOff());
+ if (zoneId != -1) {
+ found = safeGetBBDomainInfo(zoneId, &bbd);
+ if (found) {
+ domain = bbd.d_name;
+ }
+ }
+ else {
+ do {
+ found = safeGetBBDomainInfo(domain, &bbd);
+ } while (!found && domain.chopOff());
+ }
if(!found) {
if(mustlog)