summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-02-27 17:00:49 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-02-27 17:00:49 +0000
commit943b3bd703bc081e3fe37a126b59732a35293d99 (patch)
treeaa192fe5bf9c90ccabd4982890a3ab4962fa4047 /src
parent5337749660798aa0ca19d8259e2f4f39cb7109a1 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp7
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp7
2 files changed, 14 insertions, 0 deletions
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)))
{