summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/SslConnectionOpenSSL.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/SslConnectionOpenSSL.cpp')
-rw-r--r--cpp/src/Ice/SslConnectionOpenSSL.cpp36
1 files changed, 22 insertions, 14 deletions
diff --git a/cpp/src/Ice/SslConnectionOpenSSL.cpp b/cpp/src/Ice/SslConnectionOpenSSL.cpp
index a8f937710b7..3b150bb3f49 100644
--- a/cpp/src/Ice/SslConnectionOpenSSL.cpp
+++ b/cpp/src/Ice/SslConnectionOpenSSL.cpp
@@ -45,8 +45,13 @@ IceSecurity::Ssl::OpenSSL::Connection::Connection(SSL* sslConnection, string& sy
_lastError = SSL_ERROR_NONE;
- initWantRead = 0;
- initWantWrite = 0;
+ _initWantRead = 0;
+ _initWantWrite = 0;
+
+ _timeoutEncountered = false;
+
+ // None configured, default to indicated timeout
+ _handshakeReadTimeout = 0;
}
IceSecurity::Ssl::OpenSSL::Connection::~Connection()
@@ -323,7 +328,8 @@ IceSecurity::Ssl::OpenSSL::Connection::readSelect(int timeout)
}
if (ret == 0)
- {
+ {
+ _timeoutEncountered = true;
throw TimeoutException(__FILE__, __LINE__);
}
@@ -400,17 +406,19 @@ IceSecurity::Ssl::OpenSSL::Connection::readSSL(Buffer& buf, int timeout)
{
bytesPending = pending();
- if (!bytesPending && readSelect(timeout))
- {
- bytesPending = 1;
- }
-
- if (!bytesPending)
- {
- // We're done here.
- break;
- }
-
+ if (!bytesPending && readSelect(_readTimeout))
+ {
+ bytesPending = 1;
+ }
+
+ _readTimeout = timeout;
+
+ if (!bytesPending)
+ {
+ // We're done here.
+ break;
+ }
+
bytesRead = sslRead((char *)buf.i, packetSize);
switch (getLastError())