]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix hookasyncctx renaming
authorColin Vidal <colin@isc.org>
Sun, 28 Sep 2025 20:37:33 +0000 (22:37 +0200)
committerColin Vidal <colin@isc.org>
Sun, 28 Sep 2025 20:41:32 +0000 (22:41 +0200)
The field `ns_hookasync_t` was initially named `hook_actx` and wrongly
renamed `hook_aclctx` during a mass-renaming of various names for the
config acl context into a consistent `aclctx` name (see !11003). Of
course this is wrong as `ns_hookasync_t` has nothing to do with ACL but
about _async_ context. This commit fixes the mistake by renaming this
field `hookasyncctx`

lib/ns/include/ns/query.h
lib/ns/query.c
tests/ns/query_test.c

index bc1e2b0d3f665698dd08837f38ef0cc986ce7d8c..c336c80dcae0f9f9cd6aa54fe74daa885fb9b4a2 100644 (file)
@@ -118,7 +118,7 @@ struct ns_query {
        bool             authdbset;
        bool             isreferral;
        isc_mutex_t      fetchlock;
-       ns_hookasync_t  *hookaclctx;
+       ns_hookasync_t  *hookasyncctx;
        dns_rpz_st_t    *rpz_st;
        isc_bufferlist_t namebufs;
        ISC_LIST(ns_dbversion_t) activeversions;
index 47d02947c3fa79adaae760fac72e317cf1a11467..9f59e9a577f8f608649f80b533ad002341bccdfe 100644 (file)
@@ -797,9 +797,9 @@ ns_query_cancel(ns_client_t *client) {
                        *fetchp = NULL;
                }
        }
-       if (client->query.hookaclctx != NULL) {
-               client->query.hookaclctx->cancel(client->query.hookaclctx);
-               client->query.hookaclctx = NULL;
+       if (client->query.hookasyncctx != NULL) {
+               client->query.hookasyncctx->cancel(client->query.hookasyncctx);
+               client->query.hookasyncctx = NULL;
        }
        UNLOCK(&client->query.fetchlock);
 }
@@ -6607,9 +6607,9 @@ query_hookresume(void *arg) {
        REQUIRE(NS_CLIENT_VALID(client));
 
        LOCK(&client->query.fetchlock);
-       if (client->query.hookaclctx != NULL) {
-               INSIST(rev->ctx == client->query.hookaclctx);
-               client->query.hookaclctx = NULL;
+       if (client->query.hookasyncctx != NULL) {
+               INSIST(rev->ctx == client->query.hookasyncctx);
+               client->query.hookasyncctx = NULL;
                canceled = false;
                client->inner.now = isc_stdtime_now();
        } else {
@@ -6732,7 +6732,7 @@ ns_query_hookasync(query_ctx_t *qctx, ns_query_starthookasync_t runasync,
        CTRACE(ISC_LOG_DEBUG(3), "ns_query_hookasync");
 
        REQUIRE(NS_CLIENT_VALID(client));
-       REQUIRE(client->query.hookaclctx == NULL);
+       REQUIRE(client->query.hookasyncctx == NULL);
        REQUIRE(FETCH_RECTYPE_NORMAL(client) == NULL);
 
        result = acquire_recursionquota(client);
@@ -6743,7 +6743,7 @@ ns_query_hookasync(query_ctx_t *qctx, ns_query_starthookasync_t runasync,
        qctx_save(qctx, &saved_qctx);
        result = runasync(saved_qctx, client->manager->mctx, arg,
                          client->manager->loop, query_hookresume, client,
-                         &client->query.hookaclctx);
+                         &client->query.hookasyncctx);
        if (result != ISC_R_SUCCESS) {
                goto cleanup_and_detach_from_quota;
        }
index f7410f41ed15f9ff6f7126c12bfcf129b2a0b0ac..53a4964147c8593cf011e06893aff080e2d9c84e 100644 (file)
@@ -621,7 +621,7 @@ typedef struct hookasync_data {
  * this is actually called; otherwise tests would fail due to memory leak.
  */
 static void
-destroy_hookaclctx(ns_hookasync_t **ctxp) {
+destroy_hookasyncctx(ns_hookasync_t **ctxp) {
        ns_hookasync_t *ctx = *ctxp;
 
        *ctxp = NULL;
@@ -630,7 +630,7 @@ destroy_hookaclctx(ns_hookasync_t **ctxp) {
 
 /* 'cancel' callback of hook recursion ctx. */
 static void
-cancel_hookaclctx(ns_hookasync_t *ctx) {
+cancel_hookasyncctx(ns_hookasync_t *ctx) {
        /* Mark the hook data so the test can confirm this is called. */
        ((hookasync_data_t *)ctx->private)->canceled = true;
 }
@@ -662,8 +662,8 @@ test_hookasync(query_ctx_t *qctx, isc_mem_t *mctx, void *arg, isc_loop_t *loop,
        asdata->rev = rev;
 
        *ctx = (ns_hookasync_t){
-               .destroy = destroy_hookaclctx,
-               .cancel = cancel_hookaclctx,
+               .destroy = destroy_hookasyncctx,
+               .cancel = cancel_hookasyncctx,
                .private = asdata,
        };
        isc_mem_attach(mctx, &ctx->mctx);
@@ -931,7 +931,7 @@ run_hookasync_test(const ns__query_hookasync_test_params_t *test) {
                asdata.rev->cb(asdata.rev);
 
                /* Confirm necessary cleanup has been performed. */
-               INSIST(qctx->client->query.hookaclctx == NULL);
+               INSIST(qctx->client->query.hookasyncctx == NULL);
                INSIST(qctx->client->inner.state == NS_CLIENTSTATE_WORKING);
                INSIST(ns_stats_get_counter(
                               qctx->client->manager->sctx->nsstats,
@@ -947,7 +947,7 @@ run_hookasync_test(const ns__query_hookasync_test_params_t *test) {
                        INSIST(asdata.lasthookpoint == test->hookpoint2);
                }
        } else {
-               INSIST(qctx->client->query.hookaclctx == NULL);
+               INSIST(qctx->client->query.hookasyncctx == NULL);
        }
 
        /*
@@ -1246,7 +1246,7 @@ typedef struct hookasync_e2e_data {
 
 /* Cancel callback.  Just need to be defined, it doesn't have to do anything. */
 static void
-cancel_e2ehookaclctx(ns_hookasync_t *ctx) {
+cancel_e2ehookasyncctx(ns_hookasync_t *ctx) {
        UNUSED(ctx);
 }
 
@@ -1277,8 +1277,8 @@ test_hookasync_e2e(query_ctx_t *qctx, isc_mem_t *mctx, void *arg,
        asdata->rev = rev;
 
        *ctx = (ns_hookasync_t){
-               .destroy = destroy_hookaclctx,
-               .cancel = cancel_e2ehookaclctx,
+               .destroy = destroy_hookasyncctx,
+               .cancel = cancel_e2ehookasyncctx,
                .private = asdata,
        };
        isc_mem_attach(mctx, &ctx->mctx);