summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-08-01 12:01:20 +0200
committerJose <jose@zeroc.com>2016-08-01 12:01:20 +0200
commit9e408cdd73655cb6c5269aa5bfe7fc35ec48768e (patch)
tree81943ea84545f9a771f18ed88123ba9118059129 /cpp
parentFixed (ICE-7216) IceStorm test icedb lock files not being deleted (diff)
downloadice-9e408cdd73655cb6c5269aa5bfe7fc35ec48768e.tar.bz2
ice-9e408cdd73655cb6c5269aa5bfe7fc35ec48768e.tar.xz
ice-9e408cdd73655cb6c5269aa5bfe7fc35ec48768e.zip
Do not initialize OpenSSL locks if already done by other library.
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/IceSSL/OpenSSLEngine.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/cpp/src/IceSSL/OpenSSLEngine.cpp b/cpp/src/IceSSL/OpenSSLEngine.cpp
index a7232b06f7f..04409461957 100644
--- a/cpp/src/IceSSL/OpenSSLEngine.cpp
+++ b/cpp/src/IceSSL/OpenSSLEngine.cpp
@@ -63,11 +63,10 @@ public:
// the need to use a custom thread callback.
//
#if OPENSSL_VERSION_NUMBER < 0x10100000L
- CRYPTO_set_locking_callback(0);
- CRYPTO_set_id_callback(0);
-
if(locks)
{
+ CRYPTO_set_locking_callback(0);
+ CRYPTO_set_id_callback(0);
delete[] locks;
locks = 0;
}
@@ -223,7 +222,7 @@ OpenSSLEngine::OpenSSLEngine(const CommunicatorPtr& communicator) :
//
// Create the mutexes and set the callbacks.
//
- if(!locks)
+ if(!locks && !CRYPTO_get_id_callback())
{
locks = new IceUtil::Mutex[CRYPTO_num_locks()];
CRYPTO_set_locking_callback(IceSSL_opensslLockCallback);