]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
rename maybe_destroy() to maybe_cancel_validators()
authorEvan Hunt <each@isc.org>
Fri, 22 Apr 2022 18:30:12 +0000 (11:30 -0700)
committerEvan Hunt <each@isc.org>
Wed, 27 Apr 2022 17:54:28 +0000 (10:54 -0700)
the maybe_destroy() function no longer destroys the fctx,
so rename it and update the comments.

lib/dns/resolver.c

index b26b15ae61fded71365e085b7ec0cb2fae8dda64..00e6c2ea2fea20555724b8f6c25086adcf10f3d7 100644 (file)
@@ -653,7 +653,7 @@ ncache_adderesult(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
 static void
 validated(isc_task_t *task, isc_event_t *event);
 static void
-maybe_destroy(fetchctx_t *fctx, bool locked);
+maybe_cancel_validators(fetchctx_t *fctx, bool locked);
 static void
 add_bad(fetchctx_t *fctx, dns_message_t *rmessage, dns_adbaddrinfo_t *addrinfo,
        isc_result_t reason, badnstype_t badtype);
@@ -4247,7 +4247,7 @@ resume_qmin(isc_task_t *task, isc_event_t *event) {
 
        LOCK(&res->buckets[bucketnum].lock);
        if (SHUTTINGDOWN(fctx)) {
-               maybe_destroy(fctx, true);
+               maybe_cancel_validators(fctx, true);
                UNLOCK(&res->buckets[bucketnum].lock);
                fctx_detach(&fctx);
                return;
@@ -5235,18 +5235,14 @@ clone_results(fetchctx_t *fctx) {
 #define CHECKNAMES(r) (((r)->attributes & DNS_RDATASETATTR_CHECKNAMES) != 0)
 
 /*
- * Destroy '*fctx' if it is ready to be destroyed (i.e., if it has
- * no references and is no longer waiting for any events).
+ * Cancel validators associated with '*fctx' if it is ready to be
+ * destroyed (i.e., no queries waiting for it and no pending ADB finds).
  *
  * Requires:
  *      '*fctx' is shutting down.
- *
- * Returns:
- *     true if the resolver is exiting and this is the last fctx in the
- *bucket.
  */
 static void
-maybe_destroy(fetchctx_t *fctx, bool locked) {
+maybe_cancel_validators(fetchctx_t *fctx, bool locked) {
        unsigned int bucketnum;
        dns_resolver_t *res = fctx->res;
        dns_validator_t *validator, *next_validator;
@@ -5706,7 +5702,7 @@ validated(isc_task_t *task, isc_event_t *event) {
                 */
                dns_db_detachnode(fctx->cache, &node);
                if (SHUTTINGDOWN(fctx)) {
-                       maybe_destroy(fctx, true);
+                       maybe_cancel_validators(fctx, true);
                }
                UNLOCK(&res->buckets[bucketnum].lock);
                goto cleanup_event;
@@ -7321,7 +7317,7 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
 
                LOCK(&res->buckets[fctx->bucketnum].lock);
                if (SHUTTINGDOWN(fctx)) {
-                       maybe_destroy(fctx, true);
+                       maybe_cancel_validators(fctx, true);
                        UNLOCK(&res->buckets[fctx->bucketnum].lock);
                        goto cleanup;
                }
@@ -7345,7 +7341,7 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
 
                LOCK(&res->buckets[fctx->bucketnum].lock);
                if (SHUTTINGDOWN(fctx)) {
-                       maybe_destroy(fctx, true);
+                       maybe_cancel_validators(fctx, true);
                        UNLOCK(&res->buckets[fctx->bucketnum].lock);
                        goto cleanup;
                }
@@ -7381,7 +7377,7 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
 
                        LOCK(&res->buckets[fctx->bucketnum].lock);
                        if (SHUTTINGDOWN(fctx)) {
-                               maybe_destroy(fctx, true);
+                               maybe_cancel_validators(fctx, true);
                                UNLOCK(&res->buckets[fctx->bucketnum].lock);
                                goto cleanup;
                        }
@@ -7408,7 +7404,7 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
 
                LOCK(&res->buckets[fctx->bucketnum].lock);
                if (SHUTTINGDOWN(fctx)) {
-                       maybe_destroy(fctx, true);
+                       maybe_cancel_validators(fctx, true);
                        UNLOCK(&res->buckets[fctx->bucketnum].lock);
                        goto cleanup;
                }