summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/SslConnectionOpenSSL.cpp9
-rw-r--r--cpp/src/Ice/SslConnectionOpenSSL.h1
-rw-r--r--cpp/src/Ice/SslConnectionOpenSSLClient.cpp21
-rw-r--r--cpp/src/Ice/SslConnectionOpenSSLServer.cpp21
4 files changed, 10 insertions, 42 deletions
diff --git a/cpp/src/Ice/SslConnectionOpenSSL.cpp b/cpp/src/Ice/SslConnectionOpenSSL.cpp
index 1502e6d2d5b..5806b0f660d 100644
--- a/cpp/src/Ice/SslConnectionOpenSSL.cpp
+++ b/cpp/src/Ice/SslConnectionOpenSSL.cpp
@@ -51,8 +51,6 @@ IceSecurity::Ssl::OpenSSL::Connection::Connection(SSL* sslConnection, string& sy
_initWantRead = 0;
_initWantWrite = 0;
- _timeoutEncountered = false;
-
// None configured, default to indicated timeout
_handshakeReadTimeout = 0;
}
@@ -75,7 +73,7 @@ IceSecurity::Ssl::OpenSSL::Connection::~Connection()
void
IceSecurity::Ssl::OpenSSL::Connection::shutdown()
{
- ICE_METHOD_INV("OpenSSL::Connection::shutdown()");
+ ICE_METHOD_INV("OpenSSL::Connection::shutdown()");
if (_sslConnection != 0)
{
@@ -400,7 +398,6 @@ IceSecurity::Ssl::OpenSSL::Connection::readSelect(int timeout)
if (ret == 0)
{
ICE_DEV_DEBUG("Connection::readSelect(): Throwing TimeoutException... SslConnectionOpenSSL.cpp, 333");
- _timeoutEncountered = true;
throw TimeoutException(__FILE__, __LINE__);
}
@@ -464,7 +461,7 @@ IceSecurity::Ssl::OpenSSL::Connection::writeSelect(int timeout)
int
IceSecurity::Ssl::OpenSSL::Connection::readSSL(Buffer& buf, int timeout)
{
- ICE_METHOD_INV("OpenSSL::Connection::readSSL()");
+ ICE_METHOD_INV("OpenSSL::Connection::readSSL()");
int packetSize = buf.b.end() - buf.i;
int totalBytesRead = 0;
@@ -479,7 +476,6 @@ IceSecurity::Ssl::OpenSSL::Connection::readSSL(Buffer& buf, int timeout)
// Ensure we're initialized.
initReturn = initialize(timeout);
-/////
if (initReturn == -1)
{
// Handshake underway, timeout immediately, easy way to deal with this.
@@ -491,7 +487,6 @@ IceSecurity::Ssl::OpenSSL::Connection::readSSL(Buffer& buf, int timeout)
// Retry the initialize call
continue;
}
-/////
// initReturn must be > 0, so we're okay to try a write
diff --git a/cpp/src/Ice/SslConnectionOpenSSL.h b/cpp/src/Ice/SslConnectionOpenSSL.h
index 141ce8531c4..96df3254100 100644
--- a/cpp/src/Ice/SslConnectionOpenSSL.h
+++ b/cpp/src/Ice/SslConnectionOpenSSL.h
@@ -185,7 +185,6 @@ protected:
SafeFlag _handshakeFlag;
int _initWantRead;
int _initWantWrite;
- bool _timeoutEncountered;
int _handshakeReadTimeout;
int _readTimeout;
};
diff --git a/cpp/src/Ice/SslConnectionOpenSSLClient.cpp b/cpp/src/Ice/SslConnectionOpenSSLClient.cpp
index 093854fb46d..aae7c7ddcf7 100644
--- a/cpp/src/Ice/SslConnectionOpenSSLClient.cpp
+++ b/cpp/src/Ice/SslConnectionOpenSSLClient.cpp
@@ -57,11 +57,6 @@ IceSecurity::Ssl::OpenSSL::ClientConnection::init(int timeout)
{
ICE_METHOD_INV("OpenSSL::ClientConnection::init()");
- if (_timeoutEncountered)
- {
- throw TimeoutException(__FILE__, __LINE__);
- }
-
int retCode = SSL_is_init_finished(_sslConnection);
while (!retCode)
@@ -70,21 +65,13 @@ IceSecurity::Ssl::OpenSSL::ClientConnection::init(int timeout)
_readTimeout = timeout > _handshakeReadTimeout ? timeout : _handshakeReadTimeout;
- try
+ if (_initWantRead)
{
- if (_initWantRead)
- {
- i = readSelect(_readTimeout);
- }
- else if (_initWantWrite)
- {
- i = writeSelect(timeout);
- }
+ i = readSelect(_readTimeout);
}
- catch (const TimeoutException&)
+ else if (_initWantWrite)
{
- _timeoutEncountered = true;
- throw;
+ i = writeSelect(timeout);
}
if (_initWantRead && i == 0)
diff --git a/cpp/src/Ice/SslConnectionOpenSSLServer.cpp b/cpp/src/Ice/SslConnectionOpenSSLServer.cpp
index a2df6549699..78459c55a0b 100644
--- a/cpp/src/Ice/SslConnectionOpenSSLServer.cpp
+++ b/cpp/src/Ice/SslConnectionOpenSSLServer.cpp
@@ -58,11 +58,6 @@ IceSecurity::Ssl::OpenSSL::ServerConnection::init(int timeout)
{
ICE_METHOD_INV("OpenSSL::ServerConnection::init()");
- if (_timeoutEncountered)
- {
- throw TimeoutException(__FILE__, __LINE__);
- }
-
int retCode = SSL_is_init_finished(_sslConnection);
while (!retCode)
@@ -71,21 +66,13 @@ IceSecurity::Ssl::OpenSSL::ServerConnection::init(int timeout)
_readTimeout = timeout > _handshakeReadTimeout ? timeout : _handshakeReadTimeout;
- try
+ if (_initWantRead)
{
- if (_initWantRead)
- {
- i = readSelect(_readTimeout);
- }
- else if (_initWantWrite)
- {
- i = writeSelect(timeout);
- }
+ i = readSelect(_readTimeout);
}
- catch (const TimeoutException&)
+ else if (_initWantWrite)
{
- _timeoutEncountered = true;
- throw;
+ i = writeSelect(timeout);
}
if (_initWantRead && i == 0)