diff options
Diffstat (limited to 'cpp/src/Ice/SslConnector.cpp')
-rw-r--r-- | cpp/src/Ice/SslConnector.cpp | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/cpp/src/Ice/SslConnector.cpp b/cpp/src/Ice/SslConnector.cpp index c1b8b33d409..a3824ecdca2 100644 --- a/cpp/src/Ice/SslConnector.cpp +++ b/cpp/src/Ice/SslConnector.cpp @@ -6,35 +6,35 @@ // // All Rights Reserved // -// **********************************************************************
-#ifdef WIN32
-#pragma warning(disable:4786)
-#endif
+// ********************************************************************** +#ifdef WIN32 +#pragma warning(disable:4786) +#endif -#include <Ice/SslFactory.h>
-#include <Ice/SslSystem.h>
+#include <Ice/SslFactory.h> +#include <Ice/SslSystem.h> #include <Ice/SslConnector.h> #include <Ice/SslTransceiver.h> #include <Ice/Instance.h> #include <Ice/TraceLevels.h> #include <Ice/Logger.h> #include <Ice/Network.h> -#include <Ice/Properties.h>
+#include <Ice/Properties.h> #include <Ice/Exception.h> -#include <Ice/SslException.h>
-#include <sstream>
+#include <Ice/SslException.h> +#include <sstream> using namespace std; using namespace Ice; using namespace IceInternal; -using std::ostringstream;
-using std::string;
-using IceSecurity::Ssl::Connection;
-using IceSecurity::Ssl::Factory;
-using IceSecurity::Ssl::System;
+using std::ostringstream; +using std::string; +using IceSecurity::Ssl::Connection; +using IceSecurity::Ssl::Factory; +using IceSecurity::Ssl::System; using IceSecurity::Ssl::ShutdownException; -
+ TransceiverPtr IceInternal::SslConnector::connect(int timeout) { @@ -55,50 +55,50 @@ IceInternal::SslConnector::connect(int timeout) _logger->trace(_traceLevels->networkCat, s.str()); } - // This is the Ice SSL Configuration File on which we will base
- // all connections in this communicator.
- string configFile = _instance->properties()->getProperty("Ice.Ssl.Config");
-
- // Get an instance of the SslOpenSSL singleton.
- System* sslSystem = Factory::getSystem(configFile);
-
- if (!sslSystem->isTraceSet())
- {
- sslSystem->setTrace(_traceLevels);
- }
-
- if (!sslSystem->isLoggerSet())
- {
- sslSystem->setLogger(_logger);
- }
-
- // Initialize the server (if needed)
- if (!sslSystem->isConfigLoaded())
- {
- sslSystem->loadConfig();
- }
- - Connection* sslConnection = 0;
-
- try
- {
- sslConnection = sslSystem->createClientConnection(fd);
- }
- catch (...)
- {
- Factory::releaseSystem(sslSystem);
- sslSystem = 0;
-
- // Shutdown the connection.
- throw;
- }
-
- TransceiverPtr transPtr = new SslTransceiver(_instance, fd, sslConnection);
-
- Factory::releaseSystem(sslSystem);
- sslSystem = 0;
- - return transPtr;
+ // This is the Ice SSL Configuration File on which we will base + // all connections in this communicator. + string configFile = _instance->properties()->getProperty("Ice.Ssl.Config"); + + // Get an instance of the SslOpenSSL singleton. + System* sslSystem = Factory::getSystem(configFile); + + if (!sslSystem->isTraceSet()) + { + sslSystem->setTrace(_traceLevels); + } + + if (!sslSystem->isLoggerSet()) + { + sslSystem->setLogger(_logger); + } + + // Initialize the server (if needed) + if (!sslSystem->isConfigLoaded()) + { + sslSystem->loadConfig(); + } + + Connection* sslConnection = 0; + + try + { + sslConnection = sslSystem->createClientConnection(fd); + } + catch (...) + { + Factory::releaseSystem(sslSystem); + sslSystem = 0; + + // Shutdown the connection. + throw; + } + + TransceiverPtr transPtr = new SslTransceiver(_instance, fd, sslConnection); + + Factory::releaseSystem(sslSystem); + sslSystem = 0; + + return transPtr; } string |