summaryrefslogtreecommitdiff
path: root/src/modules/extra
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp17
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp15
2 files changed, 20 insertions, 12 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index c8e5928bc..977c27dda 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -66,7 +66,6 @@ class ModuleSSLGnuTLS : public Module
{
Srv = Me;
SrvConf = Srv->GetConfig();
- Conf = new ConfigReader;
// Not rehashable...because I cba to reduce all the sizes of existing buffers.
inbufsize = SrvConf->NetBufferSize;
@@ -92,7 +91,6 @@ class ModuleSSLGnuTLS : public Module
if(param != "ssl")
return;
- delete Conf;
Conf = new ConfigReader;
for(unsigned int i = 0; i < listenports.size(); i++)
@@ -109,12 +107,17 @@ class ModuleSSLGnuTLS : public Module
{
// Get the port we're meant to be listening on with SSL
unsigned int port = Conf->ReadInteger("bind", "port", i, true);
- SrvConf->AddIOHook(port, this);
-
- // We keep a record of which ports we're listening on with SSL
- listenports.push_back(port);
+ if(SrvConf->AddIOHook(port, this))
+ {
+ // We keep a record of which ports we're listening on with SSL
+ listenports.push_back(port);
- log(DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %d", port);
+ log(DEFAULT, "m_ssl_gnutls.so: Enabling SSL for port %d", port);
+ }
+ else
+ {
+ log(DEFAULT, "m_ssl_gnutls.so: FAILED to enable SSL on port %d, maybe you have another ssl or similar module loaded?", port);
+ }
}
}
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index 692098dce..a1f1767e9 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -117,12 +117,17 @@ class ModuleSSLOpenSSL : public Module
{
// Get the port we're meant to be listening on with SSL
unsigned int port = Conf->ReadInteger("bind", "port", i, true);
- SrvConf->AddIOHook(port, this);
-
- // We keep a record of which ports we're listening on with SSL
- listenports.push_back(port);
+ if(SrvConf->AddIOHook(port, this))
+ {
+ // We keep a record of which ports we're listening on with SSL
+ listenports.push_back(port);
- log(DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %d", port);
+ log(DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %d", port);
+ }
+ else
+ {
+ log(DEFAULT, "m_ssl_openssl.so: FAILED to enable SSL on port %d, maybe you have another ssl or similar module loaded?", port);
+ }
}
}