summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/SslConnectionOpenSSLServer.cpp
diff options
context:
space:
mode:
authorAnthony Neal <aneal@zeroc.com>2002-04-16 18:35:24 +0000
committerAnthony Neal <aneal@zeroc.com>2002-04-16 18:35:24 +0000
commit4fe0a2b583577b91a265589e868330c3168bac5d (patch)
tree9c59f3d522c74b6b9d691adbfce867c4698da8cc /cpp/src/Ice/SslConnectionOpenSSLServer.cpp
parentUpdated to perform SSL configuration prior to server adapter activation. (diff)
downloadice-4fe0a2b583577b91a265589e868330c3168bac5d.tar.bz2
ice-4fe0a2b583577b91a265589e868330c3168bac5d.tar.xz
ice-4fe0a2b583577b91a265589e868330c3168bac5d.zip
Updated to allow for proper handling of handshake timeouts.
Diffstat (limited to 'cpp/src/Ice/SslConnectionOpenSSLServer.cpp')
-rw-r--r--cpp/src/Ice/SslConnectionOpenSSLServer.cpp36
1 files changed, 15 insertions, 21 deletions
diff --git a/cpp/src/Ice/SslConnectionOpenSSLServer.cpp b/cpp/src/Ice/SslConnectionOpenSSLServer.cpp
index 81792b6ddc6..baf36634491 100644
--- a/cpp/src/Ice/SslConnectionOpenSSLServer.cpp
+++ b/cpp/src/Ice/SslConnectionOpenSSLServer.cpp
@@ -84,27 +84,26 @@ IceSSL::OpenSSL::ServerConnection::init(int timeout)
_readTimeout = timeout > _handshakeReadTimeout ? timeout : _handshakeReadTimeout;
- if (_initWantRead)
- {
- i = readSelect(_readTimeout);
- }
- else if (_initWantWrite)
+ if (_initWantWrite)
{
i = writeSelect(timeout);
- }
- if (_initWantRead && i == 0)
- {
- return 0;
- }
+ if (i == 0)
+ {
+ return 0;
+ }
- if (_initWantWrite && i == 0)
- {
- return 0;
+ _initWantWrite = 0;
}
+ else
+ {
+ i = readSelect(_readTimeout);
- _initWantRead = 0;
- _initWantWrite = 0;
+ if (i == 0)
+ {
+ return 0;
+ }
+ }
int result = accept();
@@ -144,18 +143,13 @@ IceSSL::OpenSSL::ServerConnection::init(int timeout)
// Find out what the error was (if any).
switch (getLastError())
{
- case SSL_ERROR_WANT_READ:
- {
- _initWantRead = 1;
- break;
- }
-
case SSL_ERROR_WANT_WRITE:
{
_initWantWrite = 1;
break;
}
+ case SSL_ERROR_WANT_READ:
case SSL_ERROR_NONE:
case SSL_ERROR_WANT_X509_LOOKUP:
{