From 3c68d83766d0eea30ed70888e537a1deb4c309ff Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 22 Mar 2007 18:38:38 +0000 Subject: More checks in IS_HSDONE event hook git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6695 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ssl_gnutls.cpp | 3 +++ src/modules/extra/m_ssl_openssl.cpp | 3 +++ 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 964e488d1..c9a421e39 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -309,6 +309,9 @@ class ModuleSSLGnuTLS : public Module } else if (strcmp("IS_HSDONE", request->GetId()) == 0) { + if (ISR->Sock->GetFd() < 0) + return (char*)"OK"; + issl_session* session = &sessions[ISR->Sock->GetFd()]; return (session->status == ISSL_HANDSHAKING_READ || session->status == ISSL_HANDSHAKING_WRITE) ? NULL : (char*)"OK"; } diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 7ed29ec37..6e2b713f9 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -359,6 +359,9 @@ class ModuleSSLOpenSSL : public Module } else if (strcmp("IS_HSDONE", request->GetId()) == 0) { + if (ISR->Sock->GetFd() < 0) + return (char*)"OK"; + issl_session* session = &sessions[ISR->Sock->GetFd()]; return (session->status == ISSL_HANDSHAKING) ? NULL : (char*)"OK"; } -- cgit v1.2.3