From 8fe441db7cfddb90bc6fca2e33dfffd2ae68dca7 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 1 Jan 2007 00:25:26 +0000 Subject: Fix this so it works properly, and removes the descriptions on unload (when the sockets revert back to plaintext) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6197 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ssl_gnutls.cpp | 7 ++++++- src/modules/extra/m_ssl_openssl.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/modules') diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index e5c316035..fbd809742 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -141,7 +141,7 @@ class ModuleSSLGnuTLS : public Module { listenports.push_back(portno); for (unsigned int i = 0; i < ServerInstance->stats->BoundPortCount; i++) - if (ServerInstance->Config->ports[i]) + if (ServerInstance->Config->ports[i] == portno) ServerInstance->Config->openSockfd[i]->SetDescription("ssl"); ServerInstance->Log(DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %d", portno); } @@ -259,7 +259,12 @@ class ModuleSSLGnuTLS : public Module ServerInstance->Log(DEBUG, "m_ssl_gnutls.so: Killed %d users for unload of GnuTLS SSL module", numusers); for(unsigned int i = 0; i < listenports.size(); i++) + { ServerInstance->Config->DelIOHook(listenports[i]); + for (unsigned int j = 0; j < ServerInstance->stats->BoundPortCount; j++) + if (ServerInstance->Config->ports[j] == listenports[i]) + ServerInstance->Config->openSockfd[j]->SetDescription("plaintext"); + } } } diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index c5b6d1c62..ca690fb8f 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -165,7 +165,7 @@ class ModuleSSLOpenSSL : public Module { listenports.push_back(portno); for (unsigned int i = 0; i < ServerInstance->stats->BoundPortCount; i++) - if (ServerInstance->Config->ports[i]) + if (ServerInstance->Config->ports[i] == portno) ServerInstance->Config->openSockfd[i]->SetDescription("ssl"); ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %d", portno); } @@ -293,7 +293,12 @@ class ModuleSSLOpenSSL : public Module ServerInstance->Log(DEBUG, "m_ssl_openssl.so: Killed %d users for unload of OpenSSL SSL module", numusers); for(unsigned int i = 0; i < listenports.size(); i++) + { ServerInstance->Config->DelIOHook(listenports[i]); + for (unsigned int j = 0; j < ServerInstance->stats->BoundPortCount; j++) + if (ServerInstance->Config->ports[j] == listenports[i]) + ServerInstance->Config->openSockfd[j]->SetDescription("plaintext"); + } } } -- cgit v1.2.3