counter = isc_mem_get(fctx->mctx, sizeof(*counter));
*counter = (fctxcount_t){
.magic = FCTXCOUNT_MAGIC,
- .count = 0,
- .allowed = 0,
};
isc_mem_attach(fctx->mctx, &counter->mctx);
isc_mutex_init(&counter->lock);
fetchctx_ref(fctx);
result = dns_resolver_createfetch(
fctx->res, fctx->qminname, fctx->qmintype, fctx->domain,
- &fctx->nameservers, NULL, NULL, 0, options, 0, fctx->qc,
+ &fctx->nameservers, NULL, NULL, 0,
+ options | DNS_FETCHOPT_QMINFETCH, 0, fctx->qc,
fctx->gqc, fctx->loop, resume_qmin, fctx, &fctx->edectx,
&fctx->qminrrset, NULL, &fctx->qminfetch);
if (result != ISC_R_SUCCESS) {
dns_name_copy(fname, fctx->domain);
- result = fcount_incr(fctx, true);
+ result = fcount_incr(fctx, false);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
/*
* Exempt prefetch queries from the fetches-per-zone quota check
+ * also exempt QMIN fetches as the calling fetch has already
+ * successfully called fcount_incr for this zone.
*/
- if ((fctx->options & DNS_FETCHOPT_PREFETCH) == 0) {
+ if ((fctx->options & DNS_FETCHOPT_PREFETCH) == 0 &&
+ (fctx->options & DNS_FETCHOPT_QMINFETCH) == 0)
+ {
/*
* Are there too many simultaneous queries for this domain?
*/
fcount_decr(fctx);
dns_name_copy(fctx->nsname, fctx->domain);
- result = fcount_incr(fctx, true);
+ result = fcount_incr(fctx, false);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
fctx_minimize_qname(fctx);
}
- result = fcount_incr(fctx, true);
+ result = fcount_incr(fctx, false);
if (result != ISC_R_SUCCESS) {
rctx->result = result;
return ISC_R_COMPLETE;