git-svn-id: file:///svn/unbound/trunk@3392 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2015-04-10 10:57:25 +00:00
parent e30a90febc
commit bc658e0361
3 changed files with 11 additions and 4 deletions

View file

@ -993,7 +993,7 @@ nameservers for those zones.
.TP 5
.B ratelimit\-size: \fI<memory size>
Give the size of the data structure in which the current ongoing rates are
kep track in. Default 4m. In bytes or use m(mega), k(kilo), g(giga).
kept track in. Default 4m. In bytes or use m(mega), k(kilo), g(giga).
The ratelimit structure is small, so this data structure likely does
not need to be large.
.TP 5

View file

@ -1954,7 +1954,8 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
if(!outq) {
log_addr(VERB_DETAIL, "error sending query to auth server",
&target->addr, target->addrlen);
infra_ratelimit_dec(qstate->env->infra_cache, iq->dp->name,
if(!(iq->chase_flags & BIT_RD))
infra_ratelimit_dec(qstate->env->infra_cache, iq->dp->name,
iq->dp->namelen, *qstate->env->now);
return next_state(iq, QUERYTARGETS_STATE);
}

View file

@ -162,13 +162,17 @@ static struct domain_limit_data* domain_limit_findcreate(
/* can we find it? */
d = (struct domain_limit_data*)name_tree_find(&infra->domain_limits,
nm, nmlen, labs, LDNS_RR_CLASS_IN);
if(d)
if(d) {
free(nm);
return d;
}
/* create it */
d = (struct domain_limit_data*)calloc(1, sizeof(*d));
if(!d)
if(!d) {
free(nm);
return NULL;
}
d->node.node.key = &d->node;
d->node.name = nm;
d->node.len = nmlen;
@ -179,6 +183,8 @@ static struct domain_limit_data* domain_limit_findcreate(
if(!name_tree_insert(&infra->domain_limits, &d->node, nm, nmlen,
labs, LDNS_RR_CLASS_IN)) {
log_err("duplicate element in domainlimit tree");
free(nm);
free(d);
return NULL;
}
return d;