2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

TLS: add isc__nmsocket_timer_running() support

This commit adds isc__nmsocket_timer_running() support to the generic
TLS code in order to make it more compatible with TCP.
This commit is contained in:
Artem Boldariev 2022-07-26 17:36:32 +03:00
parent c0808532e1
commit f18a9b3743
3 changed files with 26 additions and 0 deletions

View File

@ -1583,6 +1583,9 @@ void
isc__nmhandle_tls_setwritetimeout(isc_nmhandle_t *handle, isc__nmhandle_tls_setwritetimeout(isc_nmhandle_t *handle,
uint64_t write_timeout); uint64_t write_timeout);
bool
isc__nmsocket_tls_timer_running(isc_nmsocket_t *sock);
void void
isc__nm_tls_failed_read_cb(isc_nmsocket_t *sock, isc_result_t result, isc__nm_tls_failed_read_cb(isc_nmsocket_t *sock, isc_result_t result,
bool async); bool async);

View File

@ -1545,6 +1545,15 @@ bool
isc__nmsocket_timer_running(isc_nmsocket_t *sock) { isc__nmsocket_timer_running(isc_nmsocket_t *sock) {
REQUIRE(VALID_NMSOCK(sock)); REQUIRE(VALID_NMSOCK(sock));
switch (sock->type) {
#ifdef HAVE_LIBNGHTTP2
case isc_nm_tlssocket:
return (isc__nmsocket_tls_timer_running(sock));
#endif /* HAVE_LIBNGHTTP2 */
default:
break;
}
return (uv_is_active((uv_handle_t *)&sock->read_timer)); return (uv_is_active((uv_handle_t *)&sock->read_timer));
} }

View File

@ -1215,6 +1215,20 @@ isc__nmsocket_tls_reset(isc_nmsocket_t *sock) {
} }
} }
bool
isc__nmsocket_tls_timer_running(isc_nmsocket_t *sock) {
REQUIRE(VALID_NMSOCK(sock));
REQUIRE(sock->type == isc_nm_tlssocket);
if (sock->outerhandle != NULL) {
INSIST(VALID_NMHANDLE(sock->outerhandle));
REQUIRE(VALID_NMSOCK(sock->outerhandle->sock));
return (isc__nmsocket_timer_running(sock->outerhandle->sock));
}
return (false);
}
const char * const char *
isc__nm_tls_verify_tls_peer_result_string(const isc_nmhandle_t *handle) { isc__nm_tls_verify_tls_peer_result_string(const isc_nmhandle_t *handle) {
isc_nmsocket_t *sock = NULL; isc_nmsocket_t *sock = NULL;