2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Cleanup the isc_counter unit

The isc_counter_create() doesn't need the return value (it was always
ISC_R_SUCCESS), use the macros to implement the reference counting,
little style cleanup, and expand the unit test.
This commit is contained in:
Ondřej Surý
2025-02-19 06:49:38 +01:00
parent f0785fedf1
commit 77ec2a6c22
6 changed files with 34 additions and 78 deletions

View File

@@ -939,10 +939,7 @@ startresolve(dns_client_t *client, const dns_name_t *name,
rctx->magic = RCTX_MAGIC;
isc_refcount_increment(&client->references);
result = isc_counter_create(mctx, client->max_queries, &rctx->qc);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
isc_counter_create(mctx, client->max_queries, &rctx->qc);
ISC_LIST_APPEND(client->resctxs, rctx, link);