]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use isc_job_run() for reading from StreamDNS socket
authorOndřej Surý <ondrej@isc.org>
Mon, 10 Apr 2023 05:16:45 +0000 (07:16 +0200)
committerOndřej Surý <ondrej@isc.org>
Wed, 12 Apr 2023 12:10:37 +0000 (14:10 +0200)
Change the reading in the StreamDNS code to use isc_job_run() instead of
using isc_async_run() for less allocations and more streamlined
execution.

lib/isc/netmgr/netmgr-int.h
lib/isc/netmgr/netmgr.c
lib/isc/netmgr/streamdns.c

index c9d060a67fed0d51299a92a399a900587fd8ef9f..708df672740263624ca1fe37a97b90e99d3c0853 100644 (file)
@@ -661,6 +661,8 @@ struct isc_nmsocket {
        int backtrace_size;
 #endif
        LINK(isc_nmsocket_t) active_link;
+
+       isc_job_t job;
 };
 
 void
index e7f61fee39dfd53691df3d39e200347f1153c440..5862ee4c13ab8da7f153ffe88571410f302bb514 100644 (file)
@@ -706,6 +706,7 @@ isc___nmsocket_init(isc_nmsocket_t *sock, isc__networker_t *worker,
                .active_handles = ISC_LIST_INITIALIZER,
                .active_link = ISC_LINK_INITIALIZER,
                .active = true,
+               .job = ISC_JOB_INITIALIZER,
        };
 
        if (iface != NULL) {
index fc996bd7a6f37affa4f85b1b26d0806f4a77488d..2f1c5a3bb10facd1547240a3948698e037aa1e24 100644 (file)
@@ -861,7 +861,7 @@ isc__nm_streamdns_read(isc_nmhandle_t *handle, isc_nm_recv_cb_t cb,
         */
 
        isc__nmsocket_attach(sock, &(isc_nmsocket_t *){ NULL });
-       isc_async_run(sock->worker->loop, streamdns_read_cb, sock);
+       isc_job_run(sock->worker->loop, &sock->job, streamdns_read_cb, sock);
 }
 
 void