diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/SslConnectionOpenSSL.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/SslConnectionOpenSSLServer.cpp | 36 |
2 files changed, 16 insertions, 22 deletions
diff --git a/cpp/src/Ice/SslConnectionOpenSSL.cpp b/cpp/src/Ice/SslConnectionOpenSSL.cpp index a0116fdf1c1..76e77f78131 100644 --- a/cpp/src/Ice/SslConnectionOpenSSL.cpp +++ b/cpp/src/Ice/SslConnectionOpenSSL.cpp @@ -445,7 +445,7 @@ IceSSL::OpenSSL::Connection::read(Buffer& buf, int timeout) continue; } - // initReturn must be > 0, so we're okay to try a write + // initReturn must be > 0, so we're okay to try a read bytesPending = pending(); 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: { |