Expand workaround for zero errno to OpenSSL 3.0.x

Encountered the bug in #172 after upgrading to OpenSSL 3.0.9, so it
appears to still be present.

Occurs when writing to a connection that has been closed by the remote.
This commit is contained in:
Kim Alvefur 2023-07-05 13:19:17 +02:00
parent fddde111f7
commit a2b211f847
2 changed files with 4 additions and 4 deletions

View File

@ -48,8 +48,8 @@
//------------------------------------------------------------------------------
#if !defined(LIBRESSL_VERSION_NUMBER) && ((OPENSSL_VERSION_NUMBER & 0xFFFFF000L) == 0x10101000L)
#define LSEC_OPENSSL_1_1_1
#if !defined(LIBRESSL_VERSION_NUMBER) && ((OPENSSL_VERSION_NUMBER & 0xFFFFF000L) == 0x10101000L || (OPENSSL_VERSION_NUMBER & 0xFFFFF000L) == 0x30000000L)
#define LSEC_OPENSSL_ERRNO_BUG
#endif
//------------------------------------------------------------------------------

View File

@ -47,8 +47,8 @@ static int lsec_socket_error()
#if defined(WIN32)
return WSAGetLastError();
#else
#if defined(LSEC_OPENSSL_1_1_1)
// Bug in OpenSSL 1.1.1
#if defined(LSEC_OPENSSL_ERRNO_BUG)
// Bug in OpenSSL
if (errno == 0)
return LSEC_IO_SSL;
#endif