Skip to content

Commit

Permalink
Merge pull request #19333 from mckellyln/ssl_errno
Browse files Browse the repository at this point in the history
HPCC-33068 Securesocket handle error add errno to log message

Reviewed-by: Jake Smith <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Dec 4, 2024
2 parents a29e778 + 0a95949 commit 32e2bda
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 32e2bda

Please sign in to comment.