From e0de3da4100eb3f2bccc6ac27a46733b5b2be3dc Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 17 Feb 2010 02:02:10 +0000 Subject: Hide SSL= line of 005 if / is false git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12484 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ssl_gnutls.cpp | 27 ++++++++++++++++----------- src/modules/extra/m_ssl_openssl.cpp | 31 +++++++++++++++++-------------- 2 files changed, 33 insertions(+), 25 deletions(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 01e700885..07e11aaa7 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -183,21 +183,26 @@ class ModuleSSLGnuTLS : public Module { sslports.clear(); - for (size_t i = 0; i < ServerInstance->ports.size(); i++) + ConfigTag* Conf = ServerInstance->Config->ConfValue("gnutls"); + + if (Conf->getBool("showports", true)) { - ListenSocket* port = ServerInstance->ports[i]; - if (port->bind_tag->getString("ssl") != "gnutls") - continue; + for (size_t i = 0; i < ServerInstance->ports.size(); i++) + { + ListenSocket* port = ServerInstance->ports[i]; + if (port->bind_tag->getString("ssl") != "gnutls") + continue; - const std::string& portid = port->bind_desc; - ServerInstance->Logs->Log("m_ssl_gnutls", DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %s", portid.c_str()); + const std::string& portid = port->bind_desc; + ServerInstance->Logs->Log("m_ssl_gnutls", DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %s", portid.c_str()); - if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1") - sslports.append(portid).append(";"); - } + if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1") + sslports.append(portid).append(";"); + } - if (!sslports.empty()) - sslports.erase(sslports.end() - 1); + if (!sslports.empty()) + sslports.erase(sslports.end() - 1); + } } void OnModuleRehash(User* user, const std::string ¶m) diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index e099facd3..a0302fa9c 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -137,24 +137,27 @@ class ModuleSSLOpenSSL : public Module void OnRehash(User* user) { - ConfigReader Conf; - sslports.clear(); - for (size_t i = 0; i < ServerInstance->ports.size(); i++) + ConfigTag* Conf = ServerInstance->Config->ConfValue("openssl"); + + if (Conf->getBool("showports", true)) { - ListenSocket* port = ServerInstance->ports[i]; - if (port->bind_tag->getString("ssl") != "openssl") - continue; - - std::string portid = port->bind_desc; - ServerInstance->Logs->Log("m_ssl_openssl", DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %s", portid.c_str()); - if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1") - sslports.append(portid).append(";"); - } + for (size_t i = 0; i < ServerInstance->ports.size(); i++) + { + ListenSocket* port = ServerInstance->ports[i]; + if (port->bind_tag->getString("ssl") != "openssl") + continue; + + std::string portid = port->bind_desc; + ServerInstance->Logs->Log("m_ssl_openssl", DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %s", portid.c_str()); + if (port->bind_tag->getString("type", "clients") == "clients" && port->bind_addr != "127.0.0.1") + sslports.append(portid).append(";"); + } - if (!sslports.empty()) - sslports.erase(sslports.end() - 1); + if (!sslports.empty()) + sslports.erase(sslports.end() - 1); + } } void OnModuleRehash(User* user, const std::string ¶m) -- cgit v1.2.3