diff options
author | Mark Spruiell <mes@zeroc.com> | 2002-04-26 02:53:33 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2002-04-26 02:53:33 +0000 |
commit | 0d715a1edd4484c9b7074c9c3cb283d468a538bc (patch) | |
tree | 45934688c11aa189731ae51f07032050affd12ef /cpp/src/IceSSL/SslConnector.cpp | |
parent | Win32 fix (diff) | |
download | ice-0d715a1edd4484c9b7074c9c3cb283d468a538bc.tar.bz2 ice-0d715a1edd4484c9b7074c9c3cb283d468a538bc.tar.xz ice-0d715a1edd4484c9b7074c9c3cb283d468a538bc.zip |
Renaming Ice.Trace.Security to IceSSL.Trace.Security Cleaning up IceSSL
dependencies on Ice core
Diffstat (limited to 'cpp/src/IceSSL/SslConnector.cpp')
-rw-r--r-- | cpp/src/IceSSL/SslConnector.cpp | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/cpp/src/IceSSL/SslConnector.cpp b/cpp/src/IceSSL/SslConnector.cpp index c5faab4c860..c6d8375054b 100644 --- a/cpp/src/IceSSL/SslConnector.cpp +++ b/cpp/src/IceSSL/SslConnector.cpp @@ -17,19 +17,13 @@ # pragma warning(disable:4786) #endif -#include <Ice/Instance.h> -#include <Ice/TraceLevels.h> #include <Ice/Logger.h> #include <Ice/Network.h> -#include <Ice/Properties.h> -#include <Ice/Exception.h> #include <IceSSL/PluginBaseI.h> #include <IceSSL/SslConnector.h> #include <IceSSL/SslTransceiver.h> -#include <IceSSL/Exception.h> - -#include <sstream> +#include <IceSSL/TraceLevels.h> using namespace std; using namespace Ice; @@ -38,34 +32,29 @@ using namespace IceInternal; TransceiverPtr IceSSL::SslConnector::connect(int timeout) { - if (_traceLevels->network >= 2) + TraceLevelsPtr traceLevels = _plugin->getTraceLevels(); + LoggerPtr logger = _plugin->getLogger(); + + if (traceLevels->network >= 2) { ostringstream s; s << "trying to establish ssl connection to " << toString(); - _logger->trace(_traceLevels->networkCat, s.str()); + logger->trace(traceLevels->networkCat, s.str()); } SOCKET fd = createSocket(false); setBlock(fd, false); doConnect(fd, _addr, timeout); - if (_traceLevels->network >= 1) + if (traceLevels->network >= 1) { ostringstream s; s << "ssl connection established\n" << fdToString(fd); - _logger->trace(_traceLevels->networkCat, s.str()); + logger->trace(traceLevels->networkCat, s.str()); } - // Get the SSL plug-in - PluginManagerPtr pluginManager = _instance->pluginManager(); - Ice::PluginPtr plugin = pluginManager->getPlugin("IceSSL"); - PluginBaseIPtr sslPlugin = PluginBaseIPtr::dynamicCast(plugin); - assert(sslPlugin); - - IceSSL::ConnectionPtr connection = sslPlugin->createConnection(IceSSL::Client, fd); - TransceiverPtr transPtr = new SslTransceiver(_instance, fd, connection); - - return transPtr; + IceSSL::ConnectionPtr connection = _plugin->createConnection(IceSSL::Client, fd); + return new SslTransceiver(_plugin, fd, connection); } string @@ -74,10 +63,8 @@ IceSSL::SslConnector::toString() const return addrToString(_addr); } -IceSSL::SslConnector::SslConnector(const InstancePtr& instance, const string& host, int port) : - _instance(instance), - _traceLevels(instance->traceLevels()), - _logger(instance->logger()) +IceSSL::SslConnector::SslConnector(const PluginBaseIPtr& plugin, const string& host, int port) : + _plugin(plugin) { getAddress(host.c_str(), port, _addr); } |