]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ssl_gnutls.cpp
Change the SQLutils and SQL providers to also use interfaces for proper unload order...
[user/henk/code/inspircd.git] / src / modules / extra / m_ssl_gnutls.cpp
index 52a47b062faae08334952cc6c8c90622489708bd..1e6208b660e96ab38977a8d624c5ec9bcf761071 100644 (file)
@@ -1,3 +1,16 @@
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
+ * This program is free but copyrighted software; see
+ *            the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
 #include <string>
 #include <vector>
 
 #include "hashcomp.h"
 #include "inspircd.h"
 
-#include "ssl.h"
+#include "transport.h"
 
 /* $ModDesc: Provides SSL support for clients */
 /* $CompileFlags: `libgnutls-config --cflags` */
 /* $LinkerFlags: `perl extra/gnutls_rpath.pl` */
-/* $ModDep: ssl.h */
+/* $ModDep: transport.h */
 
 
 enum issl_status { ISSL_NONE, ISSL_HANDSHAKING_READ, ISSL_HANDSHAKING_WRITE, ISSL_HANDSHAKEN, ISSL_CLOSING, ISSL_CLOSED };
@@ -267,7 +280,16 @@ class ModuleSSLGnuTLS : public Module
                }
                else if (strcmp("IS_HOOK", request->GetId()) == 0)
                {
-                       return ServerInstance->Config->AddIOHook((Module*)this, (InspSocket*)ISR->Sock) ? (char*)"OK" : NULL;
+                       char* ret = "OK";
+                       try
+                       {
+                               ret = ServerInstance->Config->AddIOHook((Module*)this, (InspSocket*)ISR->Sock) ? (char*)"OK" : NULL;
+                       }
+                       catch (ModuleException &e)
+                       {
+                               return NULL;
+                       }
+                       return ret;
                }
                else if (strcmp("IS_UNHOOK", request->GetId()) == 0)
                {