diff options
author | Anthony Neal <aneal@zeroc.com> | 2002-04-16 18:35:24 +0000 |
---|---|---|
committer | Anthony Neal <aneal@zeroc.com> | 2002-04-16 18:35:24 +0000 |
commit | 4fe0a2b583577b91a265589e868330c3168bac5d (patch) | |
tree | 9c59f3d522c74b6b9d691adbfce867c4698da8cc /cpp/src/Ice/SslConnectionOpenSSLServer.cpp | |
parent | Updated to perform SSL configuration prior to server adapter activation. (diff) | |
download | ice-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.cpp | 36 |
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: { |