]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove unused client->shutdown and client->shutdown_arg
authorOndřej Surý <ondrej@isc.org>
Tue, 8 Feb 2022 20:32:37 +0000 (21:32 +0100)
committerOndřej Surý <ondrej@isc.org>
Thu, 17 Feb 2022 21:59:24 +0000 (22:59 +0100)
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)

lib/ns/include/ns/client.h
lib/ns/xfrout.c

index a16a3bb94f298a05d85f219806957e2f2aaf3b8e..1fd08633d30b823a4717d999dc4f3fa781880b03 100644 (file)
@@ -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;
index 2ecb03ec202c727c166393511f3b41ba9408585e..e817c40458e5a0bb0e3edb87233daf74dd19dead 100644 (file)
@@ -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
  * <client>: transfer of <zone>: <message>