summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-29 03:14:17 +0000
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-29 03:14:17 +0000
commit3ae024016df497c707ed5756b3926d9c1a264b0d (patch)
tree83ed22a9631bac6d9c3f65c18fad9cde8d616df1
parent2234920744d4ba879c7ca57c579786c177b4d50b (diff)
Add checks for AddIOHook failing
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2963 e03df62e-2008-0410-955e-edbf42e46eb7
-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);
+ }
}
}