From 0a95949591024aa49ada47fb60c41ab4dfaf7852 Mon Sep 17 00:00:00 2001 From: M Kelly Date: Tue, 3 Dec 2024 11:00:23 -0500 Subject: [PATCH] HPCC-33068 Securesocket handle error add errno to log message Signed-off-by: M Kelly --- system/security/securesocket/securesocket.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/security/securesocket/securesocket.cpp b/system/security/securesocket/securesocket.cpp index bb59476cf1b..568340590cd 100644 --- a/system/security/securesocket/securesocket.cpp +++ b/system/security/securesocket/securesocket.cpp @@ -770,6 +770,7 @@ void CSecureSocket::handleError(int ssl_err, bool writing, bool wait, unsigned t { // if !wait, then we only perform ssl_err checking, we do not wait_read/wait_write or timeout int rc = 0; + int sockErr = 0; switch (ssl_err) { case SSL_ERROR_ZERO_RETURN: @@ -791,7 +792,7 @@ void CSecureSocket::handleError(int ssl_err, bool writing, bool wait, unsigned t } case SSL_ERROR_SYSCALL: { - int sockErr = SOCKETERRNO(); + sockErr = SOCKETERRNO(); if (sockErr == EAGAIN || sockErr == EWOULDBLOCK) { if (wait) @@ -810,7 +811,7 @@ void CSecureSocket::handleError(int ssl_err, bool writing, bool wait, unsigned t char errbuf[512]; ERR_error_string_n(ssl_err, errbuf, 512); ERR_clear_error(); - VStringBuffer errmsg("%s error %d - %s", opStr, ssl_err, errbuf); + VStringBuffer errmsg("%s error %d (%d) - %s", opStr, ssl_err, sockErr, errbuf); if (m_loglevel >= SSLogMax) DBGLOG("Warning: %s", errmsg.str()); THROWJSOCKEXCEPTION_MSG(ssl_err, errmsg);