compile attempt with old OpenSSL versions

This commit is contained in:
Benjamin Sergeant 2020-11-15 11:23:44 -08:00
parent 8f5134528b
commit 508d8c7253
2 changed files with 3 additions and 5 deletions

View File

@ -86,8 +86,7 @@ namespace ix
std::atomic<bool> SocketOpenSSL::_openSSLInitializationSuccessful(false); std::atomic<bool> SocketOpenSSL::_openSSLInitializationSuccessful(false);
std::once_flag SocketOpenSSL::_openSSLInitFlag; std::once_flag SocketOpenSSL::_openSSLInitFlag;
std::unique_ptr<std::mutex[]> SocketOpenSSL::_openSSLMutexes = std::array<std::mutex[], CRYPTO_num_locks()> openSSLMutexes;
ix::make_unique<std::mutex[]>(CRYPTO_num_locks());
SocketOpenSSL::SocketOpenSSL(const SocketTLSOptions& tlsOptions, int fd) SocketOpenSSL::SocketOpenSSL(const SocketTLSOptions& tlsOptions, int fd)
: Socket(fd) : Socket(fd)
@ -129,11 +128,11 @@ namespace ix
{ {
if (mode & CRYPTO_LOCK) if (mode & CRYPTO_LOCK)
{ {
_openSSLMutexes[type].lock(); openSSLMutexes[type].lock();
} }
else else
{ {
_openSSLMutexes[type].unlock(); openSSLMutexes[type].unlock();
} }
} }

View File

@ -61,7 +61,6 @@ namespace ix
static std::once_flag _openSSLInitFlag; static std::once_flag _openSSLInitFlag;
static std::atomic<bool> _openSSLInitializationSuccessful; static std::atomic<bool> _openSSLInitializationSuccessful;
static std::unique_ptr<std::mutex[]> _openSSLMutexes;
}; };
} // namespace ix } // namespace ix