]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ssl_openssl.cpp
Change this to use our md5 provider rather than MD5() in the query
[user/henk/code/inspircd.git] / src / modules / extra / m_ssl_openssl.cpp
index cf2b192d36722dacdf39bcdeb317a220e65940ae..f46f04988c96da37e7c5849356cbeb1588287b8b 100644 (file)
@@ -2,12 +2,9 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *                <Craig@chatspike.net>
- *     
- * Written by Craig Edwards, Craig McLure, and others.
+ *  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.
  *
@@ -136,10 +133,10 @@ class ModuleSSLOpenSSL : public Module
                SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | SSL_VERIFY_CLIENT_ONCE, OnVerify);
 
                // Needs the flag as it ignores a plain /rehash
-               OnRehash("ssl");
+               OnRehash(NULL,"ssl");
        }
        
-       virtual void OnRehash(const std::string &param)
+       virtual void OnRehash(userrec* user, const std::string &param)
        {
                if (param != "ssl")
                        return;
@@ -167,6 +164,9 @@ class ModuleSSLOpenSSL : public Module
                                        if (ServerInstance->Config->AddIOHook(portno, this))
                                        {
                                                listenports.push_back(portno);
+                                               for (unsigned int i = 0; i < ServerInstance->stats->BoundPortCount; i++)
+                                                       if (ServerInstance->Config->ports[i] == portno)
+                                                               ServerInstance->Config->openSockfd[i]->SetDescription("ssl");
                                                ServerInstance->Log(DEFAULT, "m_ssl_openssl.so: Enabling SSL for port %d", portno);
                                        }
                                        else
@@ -293,7 +293,13 @@ class ModuleSSLOpenSSL : public Module
                        ServerInstance->Log(DEBUG, "m_ssl_openssl.so: Killed %d users for unload of OpenSSL SSL module", numusers);
                        
                        for(unsigned int i = 0; i < listenports.size(); i++)
+                       {
                                ServerInstance->Config->DelIOHook(listenports[i]);
+                               for (unsigned int j = 0; j < ServerInstance->stats->BoundPortCount; j++)
+                                       if (ServerInstance->Config->ports[j] == listenports[i])
+                                               if (ServerInstance->Config->openSockfd[j])
+                                                       ServerInstance->Config->openSockfd[j]->SetDescription("plaintext");
+                       }
                }
        }