mirror of https://github.com/getdnsapi/getdns.git
val. chain dont lookup "." DS and better cb lock
This commit is contained in:
parent
752ad0d420
commit
191929d105
|
@ -268,20 +268,23 @@ static void submit_link(struct validation_chain *chain, char *name)
|
||||||
link->DS.unbound_id = -1;
|
link->DS.unbound_id = -1;
|
||||||
|
|
||||||
ldns_rbtree_insert(&(chain->root), (ldns_rbnode_t *)link);
|
ldns_rbtree_insert(&(chain->root), (ldns_rbnode_t *)link);
|
||||||
/* fprintf(stderr, "submitting for: %s\n", name); */
|
|
||||||
|
|
||||||
|
chain->todo++;
|
||||||
r = ub_resolve_event(chain->dns_req->unbound,
|
r = ub_resolve_event(chain->dns_req->unbound,
|
||||||
name, LDNS_RR_TYPE_DNSKEY, LDNS_RR_CLASS_IN, &link->DNSKEY,
|
name, LDNS_RR_TYPE_DNSKEY, LDNS_RR_CLASS_IN, &link->DNSKEY,
|
||||||
ub_supporting_callback, &link->DNSKEY.unbound_id);
|
ub_supporting_callback, &link->DNSKEY.unbound_id);
|
||||||
if (r != 0)
|
if (r != 0)
|
||||||
link->DNSKEY.err = r;
|
link->DNSKEY.err = r;
|
||||||
|
|
||||||
|
if (name[0] != '.' || name[1] != '\0') {
|
||||||
r = ub_resolve_event(chain->dns_req->unbound,
|
r = ub_resolve_event(chain->dns_req->unbound,
|
||||||
name, LDNS_RR_TYPE_DS, LDNS_RR_CLASS_IN, &link->DS,
|
name, LDNS_RR_TYPE_DS, LDNS_RR_CLASS_IN, &link->DS,
|
||||||
ub_supporting_callback, &link->DS.unbound_id);
|
ub_supporting_callback, &link->DS.unbound_id);
|
||||||
if (r != 0)
|
if (r != 0)
|
||||||
link->DS.err = r;
|
link->DS.err = r;
|
||||||
}
|
}
|
||||||
|
chain->todo--;
|
||||||
|
}
|
||||||
|
|
||||||
void destroy_chain_link(ldns_rbnode_t * node, void *arg)
|
void destroy_chain_link(ldns_rbnode_t * node, void *arg)
|
||||||
{
|
{
|
||||||
|
@ -320,7 +323,6 @@ static void callback_on_complete_chain(struct validation_chain *chain)
|
||||||
((const char *)link->node.key)[1] != '\0' ))
|
((const char *)link->node.key)[1] != '\0' ))
|
||||||
todo++;
|
todo++;
|
||||||
}
|
}
|
||||||
/* fprintf(stderr, "todo until validation: %d\n", (int)todo); */
|
|
||||||
if (todo == 0) {
|
if (todo == 0) {
|
||||||
getdns_dns_req *dns_req = chain->dns_req;
|
getdns_dns_req *dns_req = chain->dns_req;
|
||||||
response = create_getdns_response(chain->dns_req);
|
response = create_getdns_response(chain->dns_req);
|
||||||
|
@ -355,7 +357,7 @@ static void get_validation_chain(getdns_dns_req *dns_req)
|
||||||
chain->mf.mf.ext.realloc = dns_req->context->mf.mf.ext.realloc;
|
chain->mf.mf.ext.realloc = dns_req->context->mf.mf.ext.realloc;
|
||||||
chain->mf.mf.ext.free = dns_req->context->mf.mf.ext.free;
|
chain->mf.mf.ext.free = dns_req->context->mf.mf.ext.free;
|
||||||
chain->dns_req = dns_req;
|
chain->dns_req = dns_req;
|
||||||
chain->todo = 1;
|
chain->todo = 0;
|
||||||
|
|
||||||
while (netreq) {
|
while (netreq) {
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -368,7 +370,6 @@ static void get_validation_chain(getdns_dns_req *dns_req)
|
||||||
}
|
}
|
||||||
netreq = netreq->next;
|
netreq = netreq->next;
|
||||||
}
|
}
|
||||||
chain->todo--;
|
|
||||||
callback_on_complete_chain(chain);
|
callback_on_complete_chain(chain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue