static void
streamdns_resume_processing(void *arg);
+static void
+async_streamdns_resume_processing(void *arg);
static void
streamdns_resumeread(isc_nmsocket_t *sock, isc_nmhandle_t *transphandle) {
* Process more DNS messages in the next loop tick.
*/
streamdns_pauseread(sock, transphandle);
- isc_async_run(sock->worker->loop, streamdns_resume_processing,
- sock);
+ isc__nmsocket_attach(sock, &(isc_nmsocket_t *){ NULL });
+ isc_async_run(sock->worker->loop,
+ async_streamdns_resume_processing, sock);
}
return false;
streamdns_handle_incoming_data(sock, sock->outerhandle, NULL, 0);
}
+static void
+async_streamdns_resume_processing(void *arg) {
+ isc_nmsocket_t *sock = (isc_nmsocket_t *)arg;
+
+ streamdns_resume_processing(sock);
+
+ isc__nmsocket_detach(&sock);
+}
+
static isc_result_t
streamdns_accept_cb(isc_nmhandle_t *handle, isc_result_t result, void *cbarg) {
isc_nmsocket_t *listensock = (isc_nmsocket_t *)cbarg;