diff options
Diffstat (limited to 'src/modules/extra/m_ssl_gnutls.cpp')
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index a7175005f..e72666062 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -439,7 +439,7 @@ class ModuleSSLGnuTLS : public Module } else if (session->status == ISSL_HANDSHAKING_WRITE) { - MakePollWrite(user); + ServerInstance->SE->ChangeEventMask(user, FD_WANT_NO_READ | FD_WANT_POLL_WRITE); return 0; } @@ -515,17 +515,18 @@ class ModuleSSLGnuTLS : public Module if (ret == (int)sendq.length()) { + ServerInstance->SE->ChangeEventMask(user, FD_WANT_NO_WRITE); return 1; } else if (ret > 0) { sendq = sendq.substr(ret); - MakePollWrite(user); + ServerInstance->SE->ChangeEventMask(user, FD_WANT_POLL_WRITE); return 0; } else if (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED) { - MakePollWrite(user); + ServerInstance->SE->ChangeEventMask(user, FD_WANT_POLL_WRITE); return 0; } else if (ret == 0) @@ -559,12 +560,13 @@ class ModuleSSLGnuTLS : public Module { // gnutls_handshake() wants to read() again. session->status = ISSL_HANDSHAKING_READ; + ServerInstance->SE->ChangeEventMask(user, FD_WANT_POLL_READ | FD_WANT_NO_WRITE); } else { // gnutls_handshake() wants to write() again. session->status = ISSL_HANDSHAKING_WRITE; - MakePollWrite(user); + ServerInstance->SE->ChangeEventMask(user, FD_WANT_NO_READ | FD_WANT_POLL_WRITE); } } else @@ -583,7 +585,7 @@ class ModuleSSLGnuTLS : public Module VerifyCertificate(session,user); // Finish writing, if any left - MakePollWrite(user); + ServerInstance->SE->ChangeEventMask(user, FD_WANT_POLL_READ | FD_WANT_NO_WRITE | FD_ADD_TRIAL_WRITE); return true; } @@ -605,11 +607,6 @@ class ModuleSSLGnuTLS : public Module } } - void MakePollWrite(EventHandler* eh) - { - ServerInstance->SE->WantWrite(eh); - } - void CloseSession(issl_session* session) { if(session->sess) |