Run closehandle_cb on run queue instead of async queue

Instead of using isc_async_run() when closing StreamDNS handle, add
isc_job_t member to the isc_nmhandle_t structure and use isc_job_run()
to avoid allocation/deallocation on the StreamDNS hot-path.
This commit is contained in:
Ondřej Surý
2023-04-09 06:48:46 +02:00
parent d27f6f2d68
commit 74cbf523b3
3 changed files with 35 additions and 23 deletions

View File

@@ -235,7 +235,8 @@ tls_failed_read_cb(isc_nmsocket_t *sock, const isc_result_t result) {
tls_call_connect_cb(sock, handle, result);
isc__nmsocket_clearcb(sock);
isc_nmhandle_detach(&handle);
} else if (sock->recv_cb != NULL && sock->statichandle != NULL &&
} else if (sock->reading && sock->recv_cb != NULL &&
sock->statichandle != NULL &&
(sock->recv_read || result == ISC_R_TIMEDOUT))
{
sock->recv_read = false;