From bbbd6c9ac46c040b9769c227f0f3ffbfcd43b0e7 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Thu, 5 Mar 2015 16:52:06 +0100 Subject: m_ssl_gnutls, m_ssl_openssl Simplify status handling in IOHook read/write handlers Remove states ISSL_CLOSING and ISSL_CLOSED from m_ssl_gnutls --- src/modules/extra/m_ssl_openssl.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/modules/extra/m_ssl_openssl.cpp') diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 21227fe6d..c0ab862d2 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -546,8 +546,6 @@ class OpenSSLIOHook : public SSLIOHook } // If we resumed the handshake then this->status will be ISSL_OPEN - - if (status == ISSL_OPEN) { ERR_clear_error(); char* buffer = ServerInstance->GetReadBuffer(); @@ -573,7 +571,7 @@ class OpenSSLIOHook : public SSLIOHook user->SetError("Connection closed"); return -1; } - else if (ret < 0) + else // if (ret < 0) { int err = SSL_get_error(sess, ret); @@ -594,8 +592,6 @@ class OpenSSLIOHook : public SSLIOHook } } } - - return 0; } int OnStreamSocketWrite(StreamSocket* user, std::string& buffer) CXX11_OVERRIDE @@ -615,7 +611,7 @@ class OpenSSLIOHook : public SSLIOHook return ret; } - if (status == ISSL_OPEN) + // Session is ready for transferring application data { ERR_clear_error(); int ret = SSL_write(sess, buffer.data(), buffer.size()); @@ -642,7 +638,7 @@ class OpenSSLIOHook : public SSLIOHook CloseSession(); return -1; } - else if (ret < 0) + else // if (ret < 0) { int err = SSL_get_error(sess, ret); @@ -663,7 +659,6 @@ class OpenSSLIOHook : public SSLIOHook } } } - return 0; } void TellCiphersAndFingerprint(LocalUser* user) -- cgit v1.2.3