From: Ondřej Surý Date: Tue, 8 Feb 2022 20:32:37 +0000 (+0100) Subject: Remove unused client->shutdown and client->shutdown_arg X-Git-Tag: v9.16.27~17^2~3 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=6de1b12f592200a3d9401c8fa82a91117c83b45d;p=thirdparty%2Fbind9.git Remove unused client->shutdown and client->shutdown_arg While refactoring the lib/ns/xfrout.c, it was discovered that .shutdown and .shutdown_arg members of ns_client_t structure are unused. Remove the unused members and associated code that was using in it in the ns_xfrout. (cherry picked from commit 037549c40533419eecd71e2f9343cf901d276a17) --- diff --git a/lib/ns/include/ns/client.h b/lib/ns/include/ns/client.h index a16a3bb94f2..1fd08633d30 100644 --- a/lib/ns/include/ns/client.h +++ b/lib/ns/include/ns/client.h @@ -201,8 +201,6 @@ struct ns_client { uint16_t extflags; int16_t ednsversion; /* -1 noedns */ void (*cleanup)(ns_client_t *); - void (*shutdown)(void *arg, isc_result_t result); - void *shutdown_arg; ns_query_t query; isc_time_t requesttime; isc_stdtime_t now; diff --git a/lib/ns/xfrout.c b/lib/ns/xfrout.c index 2ecb03ec202..e817c40458e 100644 --- a/lib/ns/xfrout.c +++ b/lib/ns/xfrout.c @@ -695,9 +695,6 @@ xfrout_maybe_destroy(xfrout_ctx_t *xfr); static void xfrout_ctx_destroy(xfrout_ctx_t **xfrp); -static void -xfrout_client_shutdown(void *arg, isc_result_t result); - static void xfrout_log1(ns_client_t *client, dns_name_t *zonename, dns_rdataclass_t rdclass, int level, const char *fmt, ...) ISC_FORMAT_PRINTF(5, 6); @@ -1293,13 +1290,6 @@ xfrout_ctx_create(isc_mem_t *mctx, ns_client_t *client, unsigned int id, xfr->txmem = mem; xfr->txmemlen = len; - /* - * Register a shutdown callback with the client, so that we - * can stop the transfer immediately when the client task - * gets a shutdown event. - */ - xfr->client->shutdown = xfrout_client_shutdown; - xfr->client->shutdown_arg = xfr; /* * These MUST be after the last "goto failure;" / CHECK to * prevent a double free by the caller. @@ -1649,9 +1639,6 @@ xfrout_ctx_destroy(xfrout_ctx_t **xfrp) { INSIST(xfr->sends == 0); - xfr->client->shutdown = NULL; - xfr->client->shutdown_arg = NULL; - if (xfr->stream != NULL) { xfr->stream->methods->destroy(&xfr->stream); } @@ -1756,12 +1743,6 @@ xfrout_maybe_destroy(xfrout_ctx_t *xfr) { xfrout_ctx_destroy(&xfr); } -static void -xfrout_client_shutdown(void *arg, isc_result_t result) { - xfrout_ctx_t *xfr = (xfrout_ctx_t *)arg; - xfrout_fail(xfr, result, "aborted"); -} - /* * Log outgoing zone transfer messages in a format like * : transfer of :