Skip to content

Commit

Permalink
rem: dev: remove fields from struct fetchctx
Browse files Browse the repository at this point in the history
struct fetchctx does have several fields which are now unused or confusing, removing those.

Merge branch 'colin/remove-fctx-validator' into 'main'

See merge request isc-projects/bind9!9945
  • Loading branch information
Colin Vidal committed Jan 22, 2025
2 parents 87b0c1c + c9529c0 commit 1732346
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/dns/include/dns/resolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -633,4 +633,4 @@ dns_resolver_freefresp(dns_fetchresponse_t **frespp);
*
* Requires:
* \li 'frespp' is valid. No-op if *frespp == NULL
*/
*/
19 changes: 5 additions & 14 deletions lib/dns/resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ struct fetchctx {
bool hashed;
bool cloned;
bool spilled;
ISC_LINK(struct fetchctx) link;
ISC_LIST(dns_fetchresponse_t) resps;
dns_edelist_t edelist;

Expand Down Expand Up @@ -381,7 +380,6 @@ struct fetchctx {
isc_sockaddrlist_t bad;
ISC_LIST(struct tried) edns;
isc_sockaddrlist_t bad_edns;
dns_validator_t *validator;
ISC_LIST(dns_validator_t) validators;
dns_db_t *cache;
dns_adb_t *adb;
Expand Down Expand Up @@ -983,10 +981,6 @@ valcreate(fetchctx_t *fctx, dns_message_t *message, dns_adbaddrinfo_t *addrinfo,
&fctx->nfails, fctx->qc, fctx->gqc, &validator);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
inc_stats(fctx->res, dns_resstatscounter_val);
if ((valoptions & DNS_VALIDATOR_DEFER) == 0) {
INSIST(fctx->validator == NULL);
fctx->validator = validator;
}
ISC_LIST_APPEND(fctx->validators, validator, link);
return ISC_R_SUCCESS;
}
Expand Down Expand Up @@ -4787,7 +4781,6 @@ fctx_create(dns_resolver_t *res, isc_loop_t *loop, const dns_name_t *name,
dns_view_getadb(res->view, &fctx->adb);

ISC_LIST_INIT(fctx->resps);
ISC_LINK_INIT(fctx, link);
fctx->magic = FCTX_MAGIC;

/*
Expand Down Expand Up @@ -5174,6 +5167,7 @@ has_000_label(dns_rdataset_t *nsecset) {
static void
validated(void *arg) {
dns_validator_t *val = (dns_validator_t *)arg;
dns_validator_t *nextval = NULL;
dns_adbaddrinfo_t *addrinfo = NULL;
dns_dbnode_t *node = NULL;
dns_dbnode_t *nsnode = NULL;
Expand Down Expand Up @@ -5219,7 +5213,6 @@ validated(void *arg) {

LOCK(&fctx->lock);
ISC_LIST_UNLINK(fctx->validators, val, link);
fctx->validator = NULL;
UNLOCK(&fctx->lock);

/*
Expand Down Expand Up @@ -5346,11 +5339,9 @@ validated(void *arg) {

UNLOCK(&fctx->lock);

INSIST(fctx->validator == NULL);

fctx->validator = ISC_LIST_HEAD(fctx->validators);
if (fctx->validator != NULL) {
dns_validator_send(fctx->validator);
nextval = ISC_LIST_HEAD(fctx->validators);
if (nextval != NULL) {
dns_validator_send(nextval);
goto cleanup_fetchctx;
} else if (sentresponse) {
done = true;
Expand Down Expand Up @@ -11078,4 +11069,4 @@ dns_resolver_freefresp(dns_fetchresponse_t **frespp) {
*frespp = NULL;
dns_ede_unlinkall(fresp->mctx, &fresp->edelist);
isc_mem_putanddetach(&fresp->mctx, fresp, sizeof(*fresp));
}
}

0 comments on commit 1732346

Please sign in to comment.