From 82ce717cd28878019efd2303aab1ea7e3ae98e16 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 5 Aug 2007 14:40:16 +0000 Subject: Fix to trigger the write notification on successful writes, too git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7662 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ssl_openssl.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 1f5a71b10..0dfc9dd29 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -589,12 +589,13 @@ class ModuleSSLOpenSSL : public Module } else if (ret < 0) { + MakePollWrite(session); + int err = SSL_get_error(session->sess, ret); if (err == SSL_ERROR_WANT_WRITE) { session->wstat = ISSL_WRITE; - MakePollWrite(session); return -1; } else if (err == SSL_ERROR_WANT_READ) @@ -611,6 +612,7 @@ class ModuleSSLOpenSSL : public Module else { session->outbuf = session->outbuf.substr(ret); + MakePollWrite(session); return ret; } } @@ -798,14 +800,14 @@ class ModuleSSLOpenSSL : public Module ServerInstance->SE->WantWrite(eh); } -virtual void OnBufferFlushed(userrec* user) -{ - if (user->GetExt("ssl")) + virtual void OnBufferFlushed(userrec* user) { - ServerInstance->Log(DEBUG,"OnBufferFlushed for ssl user"); - issl_session* session = &sessions[user->GetFd()]; - if (session && session->outbuf.size()) - OnRawSocketWrite(user->GetFd(), NULL, 0); + if (user->GetExt("ssl")) + { + ServerInstance->Log(DEBUG,"OnBufferFlushed for ssl user"); + issl_session* session = &sessions[user->GetFd()]; + if (session && session->outbuf.size()) + OnRawSocketWrite(user->GetFd(), NULL, 0); } } -- cgit v1.2.3