diff options
author | Anthony Neal <aneal@zeroc.com> | 2003-12-12 16:48:27 +0000 |
---|---|---|
committer | Anthony Neal <aneal@zeroc.com> | 2003-12-12 16:48:27 +0000 |
commit | 08c9a04f60fc6dd34c8c1508b0afb603e47d1f36 (patch) | |
tree | 17a638307333c15224e59db1446e339d852b5927 /cpp/src/IceSSL/OpenSSLPluginI.cpp | |
parent | fixes (diff) | |
download | ice-08c9a04f60fc6dd34c8c1508b0afb603e47d1f36.tar.bz2 ice-08c9a04f60fc6dd34c8c1508b0afb603e47d1f36.tar.xz ice-08c9a04f60fc6dd34c8c1508b0afb603e47d1f36.zip |
Modifications made to:
Add additional cleanup processing on Plugin destruction.
Add IceSSL.MemoryDebug messages.
Diffstat (limited to 'cpp/src/IceSSL/OpenSSLPluginI.cpp')
-rw-r--r-- | cpp/src/IceSSL/OpenSSLPluginI.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/cpp/src/IceSSL/OpenSSLPluginI.cpp b/cpp/src/IceSSL/OpenSSLPluginI.cpp index 1abddafe113..a82257a1d4a 100644 --- a/cpp/src/IceSSL/OpenSSLPluginI.cpp +++ b/cpp/src/IceSSL/OpenSSLPluginI.cpp @@ -34,6 +34,7 @@ #include <openssl/rand.h> #include <openssl/err.h> +#include <openssl/engine.h> #include <sstream> @@ -190,10 +191,24 @@ IceSSL::OpenSSLPluginI::OpenSSLPluginI(const ProtocolPluginFacadePtr& protocolPl _protocolPluginFacade(protocolPluginFacade), _traceLevels(new TraceLevels(_protocolPluginFacade)), _properties(_protocolPluginFacade->getCommunicator()->getProperties()), + _memDebug(_properties->getPropertyAsIntWithDefault("IceSSL.MemoryDebug", 0)), _serverContext(new TraceLevels(protocolPluginFacade), protocolPluginFacade->getCommunicator()), _clientContext(new TraceLevels(protocolPluginFacade), protocolPluginFacade->getCommunicator()), _randSeeded(0) { + if(_memDebug != 0) + { + CRYPTO_malloc_debug_init(); + CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL); + CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); + } + else + { + CRYPTO_set_mem_debug_functions(0, 0, 0, 0, 0); + } + + SSL_library_init(); + SSL_load_error_strings(); OpenSSL_add_ssl_algorithms(); @@ -201,8 +216,21 @@ IceSSL::OpenSSLPluginI::OpenSSLPluginI(const ProtocolPluginFacadePtr& protocolPl IceSSL::OpenSSLPluginI::~OpenSSLPluginI() { - unregisterThreads(); + _serverContext.cleanUp(); + _clientContext.cleanUp(); + + ENGINE_cleanup(); + CRYPTO_cleanup_all_ex_data(); + ERR_free_strings(); + unregisterThreads(); + + EVP_cleanup(); + + if(_memDebug != 0) + { + CRYPTO_mem_leaks_fp(stderr); + } } IceSSL::SslTransceiverPtr |