diff options
-rw-r--r-- | src/mongo/util/SConscript | 4 | ||||
-rw-r--r-- | src/mongo/util/background.cpp | 10 | ||||
-rw-r--r-- | src/mongo/util/net/message_server_port.cpp | 7 | ||||
-rw-r--r-- | src/mongo/util/net/ssl_manager.cpp | 10 | ||||
-rw-r--r-- | src/mongo/util/net/ssl_manager.h | 6 |
5 files changed, 3 insertions, 34 deletions
diff --git a/src/mongo/util/SConscript b/src/mongo/util/SConscript index f0216f3a8d1..371b3f1c845 100644 --- a/src/mongo/util/SConscript +++ b/src/mongo/util/SConscript @@ -227,9 +227,6 @@ env.Library( 'concurrency/spin_lock', 'foundation', ], - LIBDEPS_TAGS=[ - 'incomplete' - ], ) env.CppUnitTest( @@ -240,7 +237,6 @@ env.CppUnitTest( LIBDEPS=[ "background_job", "concurrency/synchronization", - "net/network", # Temporary crutch since the ssl cleanup is hard coded in background.cpp ], ) diff --git a/src/mongo/util/background.cpp b/src/mongo/util/background.cpp index f316f31e683..c7bf42d6fd4 100644 --- a/src/mongo/util/background.cpp +++ b/src/mongo/util/background.cpp @@ -44,7 +44,6 @@ #include "mongo/util/debug_util.h" #include "mongo/util/log.h" #include "mongo/util/mongoutils/str.h" -#include "mongo/util/net/ssl_manager.h" #include "mongo/util/timer.h" using namespace std; @@ -158,15 +157,6 @@ void BackgroundJob::jobBody() { // We must cache this value so that we can use it after we leave the following scope. const bool selfDelete = _selfDelete; -#ifdef MONGO_CONFIG_SSL - // TODO(sverch): Allow people who use the BackgroundJob to also specify cleanup tasks. - // Currently the networking code depends on this class and this class depends on the - // networking code because of this ad hoc cleanup. - SSLManagerInterface* manager = getSSLManager(); - if (manager) - manager->cleanupThreadLocals(); -#endif - { // It is illegal to access any state owned by this BackgroundJob after leaving this // scope, with the exception of the call to 'delete this' below. diff --git a/src/mongo/util/net/message_server_port.cpp b/src/mongo/util/net/message_server_port.cpp index fc61454203d..3ae624d7073 100644 --- a/src/mongo/util/net/message_server_port.cpp +++ b/src/mongo/util/net/message_server_port.cpp @@ -248,13 +248,6 @@ private: } portWithHandler->shutdown(); -// Normal disconnect path. -#ifdef MONGO_CONFIG_SSL - SSLManagerInterface* manager = getSSLManager(); - if (manager) - manager->cleanupThreadLocals(); -#endif - return NULL; } }; diff --git a/src/mongo/util/net/ssl_manager.cpp b/src/mongo/util/net/ssl_manager.cpp index e1cca289a99..2832a59f4d1 100644 --- a/src/mongo/util/net/ssl_manager.cpp +++ b/src/mongo/util/net/ssl_manager.cpp @@ -104,7 +104,9 @@ public: _id = _next.fetchAndAdd(1); } - ~SSLThreadInfo() {} + ~SSLThreadInfo() { + ERR_remove_state(0); + } unsigned long id() const { return _id; @@ -194,8 +196,6 @@ public: StatusWith<boost::optional<std::string>> parseAndValidatePeerCertificate( SSL* conn, const std::string& remoteHost) final; - virtual void cleanupThreadLocals(); - virtual const SSLConfiguration& getSSLConfiguration() const { return _sslConfiguration; } @@ -1035,10 +1035,6 @@ std::string SSLManager::parseAndValidatePeerCertificateDeprecated(const SSLConne return swPeerSubjectName.getValue().get_value_or(""); } -void SSLManager::cleanupThreadLocals() { - ERR_remove_state(0); -} - std::string SSLManagerInterface::getSSLErrorMessage(int code) { // 120 from the SSL documentation for ERR_error_string static const size_t msglen = 120; diff --git a/src/mongo/util/net/ssl_manager.h b/src/mongo/util/net/ssl_manager.h index d539cb15efd..6b4e35510af 100644 --- a/src/mongo/util/net/ssl_manager.h +++ b/src/mongo/util/net/ssl_manager.h @@ -121,12 +121,6 @@ public: const SSLConnection* conn, const std::string& remoteHost) = 0; /** - * Cleans up SSL thread local memory; use at thread exit - * to avoid memory leaks - */ - virtual void cleanupThreadLocals() = 0; - - /** * Gets the SSLConfiguration containing all information about the current SSL setup * @return the SSLConfiguration */ |