Skip to content

Commit

Permalink
common.h: Log all failues of ssl_*_with_timeout
Browse files Browse the repository at this point in the history
Use COMMON_LOG to log failures from wait_rd_with_timeout which includes
a timeout.
  • Loading branch information
donald committed May 23, 2021
1 parent eef7f8f commit 36d93d4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions common.h
Original file line number Diff line number Diff line change
@@ -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) {

0 comments on commit 36d93d4

Please sign in to comment.