diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-03-05 16:52:06 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-03-05 16:52:06 +0100 |
commit | bbbd6c9ac46c040b9769c227f0f3ffbfcd43b0e7 (patch) | |
tree | 3573335c16bcc7808321d09db29c1a1bb1ae9142 /src/modules/extra/m_ssl_openssl.cpp | |
parent | e9b021cc990deaf3028cb09efa3db0040b0d62a9 (diff) |
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
Diffstat (limited to 'src/modules/extra/m_ssl_openssl.cpp')
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
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) |