From 508d8c7253d992b959da6e69018db0e63ce98c47 Mon Sep 17 00:00:00 2001 From: Benjamin Sergeant Date: Sun, 15 Nov 2020 11:23:44 -0800 Subject: [PATCH] compile attempt with old OpenSSL versions --- ixwebsocket/IXSocketOpenSSL.cpp | 7 +++---- ixwebsocket/IXSocketOpenSSL.h | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ixwebsocket/IXSocketOpenSSL.cpp b/ixwebsocket/IXSocketOpenSSL.cpp index 2a14ef6d..a3e6906c 100644 --- a/ixwebsocket/IXSocketOpenSSL.cpp +++ b/ixwebsocket/IXSocketOpenSSL.cpp @@ -86,8 +86,7 @@ namespace ix std::atomic SocketOpenSSL::_openSSLInitializationSuccessful(false); std::once_flag SocketOpenSSL::_openSSLInitFlag; - std::unique_ptr SocketOpenSSL::_openSSLMutexes = - ix::make_unique(CRYPTO_num_locks()); + std::array openSSLMutexes; SocketOpenSSL::SocketOpenSSL(const SocketTLSOptions& tlsOptions, int fd) : Socket(fd) @@ -129,11 +128,11 @@ namespace ix { if (mode & CRYPTO_LOCK) { - _openSSLMutexes[type].lock(); + openSSLMutexes[type].lock(); } else { - _openSSLMutexes[type].unlock(); + openSSLMutexes[type].unlock(); } } diff --git a/ixwebsocket/IXSocketOpenSSL.h b/ixwebsocket/IXSocketOpenSSL.h index 92d9935a..dea1ffd6 100644 --- a/ixwebsocket/IXSocketOpenSSL.h +++ b/ixwebsocket/IXSocketOpenSSL.h @@ -61,7 +61,6 @@ namespace ix static std::once_flag _openSSLInitFlag; static std::atomic _openSSLInitializationSuccessful; - static std::unique_ptr _openSSLMutexes; }; } // namespace ix