From 943b3bd703bc081e3fe37a126b59732a35293d99 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 27 Feb 2007 17:00:49 +0000 Subject: Fix for small display issue, when both ssl modules are loaded, both output a 'is ssl' numeric for ssl users in whois. This fix ensures that only an ssl module thats listening on client ports will output the whois. Theres no need to bind openssl and gnutls both to client ports, however some people use openssl for server ports and gnutls for client ports, or vice versa. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6615 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ssl_gnutls.cpp | 7 +++++++ src/modules/extra/m_ssl_openssl.cpp | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index a031a13da..ea304be5d 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -80,6 +80,8 @@ class ModuleSSLGnuTLS : public Module std::string crlfile; int dh_bits; + int clientactive; + public: ModuleSSLGnuTLS(InspIRCd* Me) @@ -119,6 +121,7 @@ class ModuleSSLGnuTLS : public Module } listenports.clear(); + clientactive = 0; for(int i = 0; i < Conf->Enumerate("bind"); i++) { @@ -131,6 +134,7 @@ class ModuleSSLGnuTLS : public Module long portno = -1; while ((portno = portrange.GetToken())) { + clientactive++; try { if (ServerInstance->Config->AddIOHook(portno, this)) @@ -531,6 +535,9 @@ class ModuleSSLGnuTLS : public Module // :kenny.chatspike.net 320 Om Epy|AFK :is a Secure Connection virtual void OnWhois(userrec* source, userrec* dest) { + if (!clientactive) + return; + // Bugfix, only send this numeric for *our* SSL users if(dest->GetExt("ssl", dummy) || (IS_LOCAL(dest) && isin(dest->GetPort(), listenports))) { diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 5e6166fa4..7bb707d2c 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -114,6 +114,8 @@ class ModuleSSLOpenSSL : public Module // std::string crlfile; std::string dhfile; + int clientactive; + public: InspIRCd* PublicInstance; @@ -156,6 +158,7 @@ class ModuleSSLOpenSSL : public Module } listenports.clear(); + clientactive = 0; for (int i = 0; i < Conf->Enumerate("bind"); i++) { @@ -168,6 +171,7 @@ class ModuleSSLOpenSSL : public Module long portno = -1; while ((portno = portrange.GetToken())) { + clientactive++; try { if (ServerInstance->Config->AddIOHook(portno, this)) @@ -626,6 +630,9 @@ class ModuleSSLOpenSSL : public Module // :kenny.chatspike.net 320 Om Epy|AFK :is a Secure Connection virtual void OnWhois(userrec* source, userrec* dest) { + if (!clientactive) + return; + // Bugfix, only send this numeric for *our* SSL users if (dest->GetExt("ssl", dummy) || (IS_LOCAL(dest) && isin(dest->GetPort(), listenports))) { -- cgit v1.2.3