dns_resolver_addbadcache(res, &fctx->name,
fctx->type, &expire);
+ result = ISC_R_FAILURE;
+
/*
* If all of the addresses found were over the
* fetches-per-server quota, return the configured
if (all_spilled) {
result = res->quotaresp[dns_quotatype_server];
inc_stats(res, dns_resstatscounter_serverquota);
- } else
- result = ISC_R_FAILURE;
+ }
}
} else {
/*
return;
}
+ addrinfo = fctx_nextaddress(fctx);
+
/* Try to find an address that isn't over quota */
- while ((addrinfo = fctx_nextaddress(fctx)) != NULL)
- if (! dns_adbentry_overquota(addrinfo->entry))
- break;
+ while (addrinfo != NULL && dns_adbentry_overquota(addrinfo->entry))
+ addrinfo = fctx_nextaddress(fctx);
if (addrinfo == NULL) {
/* We have no more addresses. Start over. */
return;
}
- while ((addrinfo = fctx_nextaddress(fctx)) != NULL) {
- if (! dns_adbentry_overquota(addrinfo->entry))
- break;
- }
+ addrinfo = fctx_nextaddress(fctx);
+
+ while (addrinfo != NULL &&
+ dns_adbentry_overquota(addrinfo->entry))
+ addrinfo = fctx_nextaddress(fctx);
/*
* While we may have addresses from the ADB, they