]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_ssl_openssl.cpp
Commit patch from danieldg that makes a ton of stuff const-safe for latest warn-happy...
[user/henk/code/inspircd.git] / src / modules / extra / m_ssl_openssl.cpp
index dfecc12544d12e52016483a967ac2eb0f92b7b61..667b2a5cd3ab0665cd7cc0491527d24eacab8054 100644 (file)
@@ -167,14 +167,14 @@ class ModuleSSLOpenSSL : public Module
                clientactive = 0;
                sslports.clear();
 
-               for (int i = 0; i < Conf.Enumerate("bind"); i++)
+               for (int index = 0; index < Conf.Enumerate("bind"); index++)
                {
                        // For each <bind> tag
-                       std::string x = Conf.ReadValue("bind", "type", i);
-                       if (((x.empty()) || (x == "clients")) && (Conf.ReadValue("bind", "ssl", i) == "openssl"))
+                       std::string x = Conf.ReadValue("bind", "type", index);
+                       if (((x.empty()) || (x == "clients")) && (Conf.ReadValue("bind", "ssl", index) == "openssl"))
                        {
                                // Get the port we're meant to be listening on with SSL
-                               std::string port = Conf.ReadValue("bind", "port", i);
+                               std::string port = Conf.ReadValue("bind", "port", index);
                                irc::portparser portrange(port, false);
                                long portno = -1;
                                while ((portno = portrange.GetToken()))
@@ -343,7 +343,7 @@ class ModuleSSLOpenSSL : public Module
        }
 
 
-       virtual char* OnRequest(Request* request)
+       virtual const char* OnRequest(Request* request)
        {
                ISHRequest* ISR = (ISHRequest*)request;
                if (strcmp("IS_NAME", request->GetId()) == 0)
@@ -352,10 +352,10 @@ class ModuleSSLOpenSSL : public Module
                }
                else if (strcmp("IS_HOOK", request->GetId()) == 0)
                {
-                       char* ret = "OK";
+                       const char* ret = "OK";
                        try
                        {
-                               ret = ServerInstance->Config->AddIOHook((Module*)this, (BufferedSocket*)ISR->Sock) ? (char*)"OK" : NULL;
+                               ret = ServerInstance->Config->AddIOHook((Module*)this, (BufferedSocket*)ISR->Sock) ? "OK" : NULL;
                        }
                        catch (ModuleException &e)
                        {
@@ -366,15 +366,15 @@ class ModuleSSLOpenSSL : public Module
                }
                else if (strcmp("IS_UNHOOK", request->GetId()) == 0)
                {
-                       return ServerInstance->Config->DelIOHook((BufferedSocket*)ISR->Sock) ? (char*)"OK" : NULL;
+                       return ServerInstance->Config->DelIOHook((BufferedSocket*)ISR->Sock) ? "OK" : NULL;
                }
                else if (strcmp("IS_HSDONE", request->GetId()) == 0)
                {
                        if (ISR->Sock->GetFd() < 0)
-                               return (char*)"OK";
+                               return "OK";
 
                        issl_session* session = &sessions[ISR->Sock->GetFd()];
-                       return (session->status == ISSL_HANDSHAKING) ? NULL : (char*)"OK";
+                       return (session->status == ISSL_HANDSHAKING) ? NULL : "OK";
                }
                else if (strcmp("IS_ATTACH", request->GetId()) == 0)
                {