]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Fix crash when unloading ssl module on shutdown -- there are no port objects to set...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 6 Jan 2007 15:35:05 +0000 (15:35 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 6 Jan 2007 15:35:05 +0000 (15:35 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6230 e03df62e-2008-0410-955e-edbf42e46eb7

src/inspircd.cpp
src/modules/extra/m_ssl_gnutls.cpp
src/modules/extra/m_ssl_openssl.cpp

index 1509553ce939848f7cff4ce518b1c38e7db309cd..0bdffba64d6c368c999b2a9beffbdd1398962841 100644 (file)
@@ -80,8 +80,12 @@ void InspIRCd::Cleanup()
        int MyModCount = this->GetModuleCount();
 
        for (unsigned int i = 0; i < stats->BoundPortCount; i++)
+       {
                /* This calls the constructor and closes the listening socket */
                delete Config->openSockfd[i];
+               Config->openSockfd[i] = NULL;
+       }
+       stats->BoundPortCount = 0;
 
        /* We do this more than once, so that any service providers get a
         * chance to be unhooked by the modules using them, but then get
index 9eec655f76ba0f118523e9615293d5e923e7e0ac..808c748cc4373f0ca3b9bd62b52c9f1c5e38cf5d 100644 (file)
@@ -263,7 +263,8 @@ class ModuleSSLGnuTLS : public Module
                                ServerInstance->Config->DelIOHook(listenports[i]);
                                for (unsigned int j = 0; j < ServerInstance->stats->BoundPortCount; j++)
                                        if (ServerInstance->Config->ports[j] == listenports[i])
-                                               ServerInstance->Config->openSockfd[j]->SetDescription("plaintext");
+                                               if (ServerInstance->Config->openSockfd[j])
+                                                       ServerInstance->Config->openSockfd[j]->SetDescription("plaintext");
                        }
                }
        }
index 7ad78e2ea037e3c46dab47c4652aeb38d22a8e9e..f46f04988c96da37e7c5849356cbeb1588287b8b 100644 (file)
@@ -297,7 +297,8 @@ class ModuleSSLOpenSSL : public Module
                                ServerInstance->Config->DelIOHook(listenports[i]);
                                for (unsigned int j = 0; j < ServerInstance->stats->BoundPortCount; j++)
                                        if (ServerInstance->Config->ports[j] == listenports[i])
-                                               ServerInstance->Config->openSockfd[j]->SetDescription("plaintext");
+                                               if (ServerInstance->Config->openSockfd[j])
+                                                       ServerInstance->Config->openSockfd[j]->SetDescription("plaintext");
                        }
                }
        }