]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ssl_gnutls.cpp
Change OnHookUserIO to OnHookIO, making it usable for more than User* and less picky...
[user/henk/code/inspircd.git] / src / modules / extra / m_ssl_gnutls.cpp
index a769bd12bfae55aadb200b1b2ce5775974e7c3ab..7e3b62671cb462a34c936bfe108dd38692ec3aa6 100644 (file)
@@ -132,7 +132,7 @@ class ModuleSSLGnuTLS : public Module
                Implementation eventlist[] = { I_On005Numeric, I_OnRawSocketConnect, I_OnRawSocketAccept,
                        I_OnRawSocketClose, I_OnRawSocketRead, I_OnRawSocketWrite, I_OnCleanup,
                        I_OnBufferFlushed, I_OnRequest, I_OnUnloadModule, I_OnRehash, I_OnModuleRehash,
-                       I_OnPostConnect, I_OnEvent, I_OnHookUserIO };
+                       I_OnPostConnect, I_OnEvent, I_OnHookIO };
                ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
 
                ServerInstance->AddCommand(&starttls);
@@ -346,9 +346,9 @@ class ModuleSSLGnuTLS : public Module
                output.append(" STARTTLS");
        }
 
-       virtual void OnHookUserIO(User* user)
+       virtual void OnHookIO(EventHandler* user, ListenSocketBase* lsb)
        {
-               if (!user->GetIOHook() && isin(user->GetServerIP(),user->GetServerPort(),listenports))
+               if (!user->GetIOHook() && isin(lsb->GetIP(),lsb->GetPort(),listenports))
                {
                        /* Hook the user with our module */
                        user->AddIOHook(this);
@@ -668,8 +668,7 @@ class ModuleSSLGnuTLS : public Module
                        EventHandler *extendme = ServerInstance->SE->GetRef(fd);
                        if (extendme)
                        {
-                               if (!extendme->GetExt("ssl"))
-                                       extendme->Extend("ssl", "ON");
+                               extendme->Extend("ssl");
                        }
 
                        // Change the seesion state