mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
libdns refactoring: get rid of 3 versions of dns_resolver_createfetch
This commit is contained in:
parent
25cd3168a7
commit
42ee8c853a
@ -6565,9 +6565,9 @@ dotat(dns_keytable_t *keytable, dns_keynode_t *keynode, void *arg) {
|
||||
|
||||
result = dns_resolver_createfetch(view->resolver, tatname,
|
||||
dns_rdatatype_null, NULL, NULL,
|
||||
NULL, 0, tat->task, tat_done, tat,
|
||||
&tat->rdataset, &tat->sigrdataset,
|
||||
&tat->fetch);
|
||||
NULL, NULL, 0, 0, 0, NULL, tat->task,
|
||||
tat_done, tat, &tat->rdataset,
|
||||
&tat->sigrdataset, &tat->fetch);
|
||||
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_task_detach(&tat->task);
|
||||
|
@ -4043,12 +4043,12 @@ fetch_name(dns_adbname_t *adbname, isc_boolean_t start_at_zone,
|
||||
}
|
||||
fetch->depth = depth;
|
||||
|
||||
result = dns_resolver_createfetch3(adb->view->resolver, &adbname->name,
|
||||
type, name, nameservers, NULL,
|
||||
NULL, 0, options, depth, qc,
|
||||
adb->task, fetch_callback, adbname,
|
||||
&fetch->rdataset, NULL,
|
||||
&fetch->fetch);
|
||||
result = dns_resolver_createfetch(adb->view->resolver, &adbname->name,
|
||||
type, name, nameservers, NULL,
|
||||
NULL, 0, options, depth, qc,
|
||||
adb->task, fetch_callback, adbname,
|
||||
&fetch->rdataset, NULL,
|
||||
&fetch->fetch);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
|
@ -773,7 +773,8 @@ start_fetch(resctx_t *rctx) {
|
||||
result = dns_resolver_createfetch(rctx->view->resolver,
|
||||
dns_fixedname_name(&rctx->name),
|
||||
rctx->type,
|
||||
NULL, NULL, NULL, fopts,
|
||||
NULL, NULL, NULL, NULL, 0,
|
||||
fopts, 0, NULL,
|
||||
rctx->task, fetch_done, rctx,
|
||||
rctx->rdataset,
|
||||
rctx->sigrdataset,
|
||||
|
@ -267,35 +267,13 @@ dns_resolver_createfetch(dns_resolver_t *res, const dns_name_t *name,
|
||||
dns_rdatatype_t type,
|
||||
const dns_name_t *domain, dns_rdataset_t *nameservers,
|
||||
dns_forwarders_t *forwarders,
|
||||
unsigned int options, isc_task_t *task,
|
||||
const isc_sockaddr_t *client, isc_uint16_t id,
|
||||
unsigned int options, unsigned int depth,
|
||||
isc_counter_t *qc, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_rdataset_t *rdataset,
|
||||
dns_rdataset_t *sigrdataset,
|
||||
dns_fetch_t **fetchp);
|
||||
|
||||
isc_result_t
|
||||
dns_resolver_createfetch2(dns_resolver_t *res, const dns_name_t *name,
|
||||
dns_rdatatype_t type,
|
||||
const dns_name_t *domain, dns_rdataset_t *nameservers,
|
||||
dns_forwarders_t *forwarders,
|
||||
const isc_sockaddr_t *client, isc_uint16_t id,
|
||||
unsigned int options, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_rdataset_t *rdataset,
|
||||
dns_rdataset_t *sigrdataset,
|
||||
dns_fetch_t **fetchp);
|
||||
isc_result_t
|
||||
dns_resolver_createfetch3(dns_resolver_t *res, const dns_name_t *name,
|
||||
dns_rdatatype_t type,
|
||||
const dns_name_t *domain, dns_rdataset_t *nameservers,
|
||||
dns_forwarders_t *forwarders,
|
||||
const isc_sockaddr_t *client, isc_uint16_t id,
|
||||
unsigned int options, unsigned int depth,
|
||||
isc_counter_t *qc, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_rdataset_t *rdataset,
|
||||
dns_rdataset_t *sigrdataset,
|
||||
dns_fetch_t **fetchp);
|
||||
/*%<
|
||||
* Recurse to answer a question.
|
||||
*
|
||||
|
@ -85,7 +85,8 @@ start_fetch(dns_lookup_t *lookup) {
|
||||
result = dns_resolver_createfetch(lookup->view->resolver,
|
||||
dns_fixedname_name(&lookup->name),
|
||||
lookup->type,
|
||||
NULL, NULL, NULL, 0,
|
||||
NULL, NULL, NULL, NULL, 0, 0, 0,
|
||||
NULL,
|
||||
lookup->task, fetch_done, lookup,
|
||||
&lookup->rdataset,
|
||||
&lookup->sigrdataset,
|
||||
|
@ -268,8 +268,8 @@ checkbogus(isc_task_t *task, isc_event_t *event) {
|
||||
nta_ref(nta);
|
||||
result = dns_resolver_createfetch(view->resolver, nta->name,
|
||||
dns_rdatatype_nsec,
|
||||
NULL, NULL, NULL,
|
||||
DNS_FETCHOPT_NONTA,
|
||||
NULL, NULL, NULL, NULL, 0,
|
||||
DNS_FETCHOPT_NONTA, 0, NULL,
|
||||
task, fetch_done, nta,
|
||||
&nta->rdataset,
|
||||
&nta->sigrdataset,
|
||||
|
@ -6855,8 +6855,8 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
|
||||
|
||||
result = dns_resolver_createfetch(fctx->res, &fctx->nsname,
|
||||
dns_rdatatype_ns, domain,
|
||||
nsrdataset, NULL,
|
||||
fctx->options, task,
|
||||
nsrdataset, NULL, NULL, 0,
|
||||
fctx->options, 0, NULL, task,
|
||||
resume_dslookup, fctx,
|
||||
&fctx->nsrrset, NULL,
|
||||
&fctx->nsfetch);
|
||||
@ -9117,8 +9117,8 @@ rctx_chaseds(respctx_t *rctx, dns_adbaddrinfo_t *addrinfo, isc_result_t result)
|
||||
|
||||
result = dns_resolver_createfetch(fctx->res, &fctx->nsname,
|
||||
dns_rdatatype_ns,
|
||||
NULL, NULL, NULL,
|
||||
fctx->options, rctx->task,
|
||||
NULL, NULL, NULL, NULL, 0,
|
||||
fctx->options, 0, NULL, rctx->task,
|
||||
resume_dslookup, fctx,
|
||||
&fctx->nsrrset, NULL,
|
||||
&fctx->nsfetch);
|
||||
@ -9982,7 +9982,8 @@ dns_resolver_prime(dns_resolver_t *res) {
|
||||
LOCK(&res->primelock);
|
||||
result = dns_resolver_createfetch(res, dns_rootname,
|
||||
dns_rdatatype_ns,
|
||||
NULL, NULL, NULL, 0,
|
||||
NULL, NULL, NULL, NULL, 0, 0,
|
||||
0, NULL,
|
||||
res->buckets[0].task,
|
||||
prime_done,
|
||||
res, rdataset, NULL,
|
||||
@ -10176,48 +10177,13 @@ dns_resolver_createfetch(dns_resolver_t *res, const dns_name_t *name,
|
||||
dns_rdatatype_t type,
|
||||
const dns_name_t *domain, dns_rdataset_t *nameservers,
|
||||
dns_forwarders_t *forwarders,
|
||||
unsigned int options, isc_task_t *task,
|
||||
const isc_sockaddr_t *client, dns_messageid_t id,
|
||||
unsigned int options, unsigned int depth,
|
||||
isc_counter_t *qc, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_rdataset_t *rdataset,
|
||||
dns_rdataset_t *sigrdataset,
|
||||
dns_fetch_t **fetchp)
|
||||
{
|
||||
return (dns_resolver_createfetch3(res, name, type, domain,
|
||||
nameservers, forwarders, NULL, 0,
|
||||
options, 0, NULL, task, action, arg,
|
||||
rdataset, sigrdataset, fetchp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_resolver_createfetch2(dns_resolver_t *res, const dns_name_t *name,
|
||||
dns_rdatatype_t type,
|
||||
const dns_name_t *domain, dns_rdataset_t *nameservers,
|
||||
dns_forwarders_t *forwarders,
|
||||
const isc_sockaddr_t *client, dns_messageid_t id,
|
||||
unsigned int options, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_rdataset_t *rdataset,
|
||||
dns_rdataset_t *sigrdataset,
|
||||
dns_fetch_t **fetchp)
|
||||
{
|
||||
return (dns_resolver_createfetch3(res, name, type, domain,
|
||||
nameservers, forwarders, client, id,
|
||||
options, 0, NULL, task, action, arg,
|
||||
rdataset, sigrdataset, fetchp));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_resolver_createfetch3(dns_resolver_t *res, const dns_name_t *name,
|
||||
dns_rdatatype_t type,
|
||||
const dns_name_t *domain, dns_rdataset_t *nameservers,
|
||||
dns_forwarders_t *forwarders,
|
||||
const isc_sockaddr_t *client, dns_messageid_t id,
|
||||
unsigned int options, unsigned int depth,
|
||||
isc_counter_t *qc, isc_task_t *task,
|
||||
isc_taskaction_t action, void *arg,
|
||||
dns_rdataset_t *rdataset,
|
||||
dns_rdataset_t *sigrdataset,
|
||||
dns_fetch_t **fetchp)
|
||||
{
|
||||
dns_fetch_t *fetch;
|
||||
fetchctx_t *fctx = NULL;
|
||||
|
@ -1153,8 +1153,8 @@ create_fetch(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type,
|
||||
|
||||
validator_logcreate(val, name, type, caller, "fetch");
|
||||
return (dns_resolver_createfetch(val->view->resolver, name, type,
|
||||
NULL, NULL, NULL, fopts,
|
||||
val->event->ev_sender,
|
||||
NULL, NULL, NULL, NULL, 0, fopts,
|
||||
0, NULL, val->event->ev_sender,
|
||||
callback, val,
|
||||
&val->frdataset,
|
||||
&val->fsigrdataset,
|
||||
|
@ -862,8 +862,6 @@ dns_resolver_attach
|
||||
dns_resolver_cancelfetch
|
||||
dns_resolver_create
|
||||
dns_resolver_createfetch
|
||||
dns_resolver_createfetch2
|
||||
dns_resolver_createfetch3
|
||||
dns_resolver_destroyfetch
|
||||
dns_resolver_detach
|
||||
dns_resolver_disable_algorithm
|
||||
|
@ -9790,11 +9790,11 @@ zone_refreshkeys(dns_zone_t *zone) {
|
||||
*/
|
||||
result = dns_resolver_createfetch(zone->view->resolver,
|
||||
kname, dns_rdatatype_dnskey,
|
||||
NULL, NULL, NULL,
|
||||
DNS_FETCHOPT_NOVALIDATE|
|
||||
DNS_FETCHOPT_UNSHARED|
|
||||
NULL, NULL, NULL, NULL, 0,
|
||||
DNS_FETCHOPT_NOVALIDATE |
|
||||
DNS_FETCHOPT_UNSHARED |
|
||||
DNS_FETCHOPT_NOCACHED,
|
||||
zone->task,
|
||||
0, NULL, zone->task,
|
||||
keyfetch_done, kfetch,
|
||||
&kfetch->dnskeyset,
|
||||
&kfetch->dnskeysigset,
|
||||
|
@ -2446,13 +2446,13 @@ query_prefetch(ns_client_t *client, dns_name_t *qname,
|
||||
peeraddr = NULL;
|
||||
ns_client_attach(client, &dummy);
|
||||
options = client->query.fetchoptions | DNS_FETCHOPT_PREFETCH;
|
||||
result = dns_resolver_createfetch3(client->view->resolver,
|
||||
qname, rdataset->type, NULL, NULL,
|
||||
NULL, peeraddr, client->message->id,
|
||||
options, 0, NULL, client->task,
|
||||
prefetch_done, client,
|
||||
tmprdataset, NULL,
|
||||
&client->query.prefetch);
|
||||
result = dns_resolver_createfetch(client->view->resolver,
|
||||
qname, rdataset->type, NULL, NULL,
|
||||
NULL, peeraddr, client->message->id,
|
||||
options, 0, NULL, client->task,
|
||||
prefetch_done, client,
|
||||
tmprdataset, NULL,
|
||||
&client->query.prefetch);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
query_putrdataset(client, &tmprdataset);
|
||||
ns_client_detach(&dummy);
|
||||
@ -2653,12 +2653,12 @@ query_rpzfetch(ns_client_t *client, dns_name_t *qname, dns_rdatatype_t type) {
|
||||
peeraddr = NULL;
|
||||
ns_client_attach(client, &dummy);
|
||||
options = client->query.fetchoptions;
|
||||
result = dns_resolver_createfetch3(client->view->resolver, qname, type,
|
||||
NULL, NULL, NULL, peeraddr,
|
||||
client->message->id, options, 0,
|
||||
NULL, client->task, prefetch_done,
|
||||
client, tmprdataset, NULL,
|
||||
&client->query.prefetch);
|
||||
result = dns_resolver_createfetch(client->view->resolver, qname, type,
|
||||
NULL, NULL, NULL, peeraddr,
|
||||
client->message->id, options, 0,
|
||||
NULL, client->task, prefetch_done,
|
||||
client, tmprdataset, NULL,
|
||||
&client->query.prefetch);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
query_putrdataset(client, &tmprdataset);
|
||||
ns_client_detach(&dummy);
|
||||
@ -5650,13 +5650,13 @@ query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qname,
|
||||
peeraddr = &client->peeraddr;
|
||||
}
|
||||
|
||||
result = dns_resolver_createfetch3(client->view->resolver,
|
||||
qname, qtype, qdomain, nameservers,
|
||||
NULL, peeraddr, client->message->id,
|
||||
client->query.fetchoptions, 0, NULL,
|
||||
client->task, fetch_callback,
|
||||
client, rdataset, sigrdataset,
|
||||
&client->query.fetch);
|
||||
result = dns_resolver_createfetch(client->view->resolver,
|
||||
qname, qtype, qdomain, nameservers,
|
||||
NULL, peeraddr, client->message->id,
|
||||
client->query.fetchoptions, 0, NULL,
|
||||
client->task, fetch_callback,
|
||||
client, rdataset, sigrdataset,
|
||||
&client->query.fetch);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
query_putrdataset(client, &rdataset);
|
||||
if (sigrdataset != NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user