Skip to content

Commit

Permalink
HPCC-33068 Securesocket handle error add errno to log message
Browse files Browse the repository at this point in the history
Signed-off-by: M Kelly <[email protected]>
  • Loading branch information
mckellyln committed Dec 3, 2024
1 parent 130a3a9 commit 0a95949
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions system/security/securesocket/securesocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit 0a95949

Please sign in to comment.