diff options
author | Anthony Neal <aneal@zeroc.com> | 2001-11-30 19:58:47 +0000 |
---|---|---|
committer | Anthony Neal <aneal@zeroc.com> | 2001-11-30 19:58:47 +0000 |
commit | 0943a96869b83130fb7f2c3983a918a0dbad144b (patch) | |
tree | 45203542428d3f0776f88e98733eb1ad47dbabbc /cpp/src/Ice/SslConnectionOpenSSL.cpp | |
parent | converted some stuff to use Application.h (diff) | |
download | ice-0943a96869b83130fb7f2c3983a918a0dbad144b.tar.bz2 ice-0943a96869b83130fb7f2c3983a918a0dbad144b.tar.xz ice-0943a96869b83130fb7f2c3983a918a0dbad144b.zip |
Have fixed the handshake problem, now handshakes take place in the
read/write methods. As well, I have changed the configuration
properties to be under the Ice.Security.* branch of properties. I have
added a new configuration property having to do with the timeout value
for the first read after the handshake has completed - the default
value should be sufficient, but in case it is not, this is a tweak that
is avaliable.
Diffstat (limited to 'cpp/src/Ice/SslConnectionOpenSSL.cpp')
-rw-r--r-- | cpp/src/Ice/SslConnectionOpenSSL.cpp | 36 |
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()) |