From 36d93d471476951bc530c6ea45df5a39ddb399e5 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Sun, 23 May 2021 13:35:48 +0200 Subject: [PATCH] common.h: Log all failues of ssl_*_with_timeout Use COMMON_LOG to log failures from wait_rd_with_timeout which includes a timeout. --- common.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/common.h b/common.h index fd365e3..380264c 100644 --- a/common.h +++ b/common.h @@ -99,8 +99,10 @@ static int __attribute__((unused)) ssl_write_with_timeout(SSL *ssl, int fd, char switch (ssl_error) { case SSL_ERROR_WANT_READ: status = wait_rd_with_timeout(fd, timeout); - if (status == -1) + if (status == -1) { + COMMON_LOG(LOG_ERR, "%s: %m", __func__); return -1; + } continue; case SSL_ERROR_SYSCALL: COMMON_LOG(LOG_ERR, "%s: %m", __func__); @@ -127,8 +129,10 @@ static int __attribute__((unused)) ssl_read_with_timeout(SSL *ssl, int fd, void switch (ssl_error) { case SSL_ERROR_WANT_READ: status = wait_rd_with_timeout(fd, timeout); - if (status == -1) + if (status == -1) { + COMMON_LOG(LOG_ERR, "%s: %m", __func__); return -1; + } continue; case SSL_ERROR_SYSCALL: if (errno == 0) { @@ -158,8 +162,10 @@ static int __attribute__((unused)) ssl_accept_with_timeout(SSL *ssl, int fd, in switch (ssl_error) { case SSL_ERROR_WANT_READ: status = wait_rd_with_timeout(fd, timeout); - if (status == -1) + if (status == -1) { + COMMON_LOG(LOG_ERR, "%s: %m", __func__); return -1; + } continue; case SSL_ERROR_SYSCALL: if (errno == 0) {