]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_spanningtree Fix cleanup of connections when unloading a module that provides an...
authorAttila Molnar <attilamolnar@hush.com>
Thu, 5 Jun 2014 23:46:21 +0000 (01:46 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Thu, 5 Jun 2014 23:46:21 +0000 (01:46 +0200)
src/modules/m_spanningtree/main.cpp

index d702ab4a25c9d93e497a5283c945de4c5dc3cc85..e7ff3789bfe7b6ca8253b8c6b25f0397a1fcd0be 100644 (file)
@@ -806,6 +806,7 @@ void ModuleSpanningTree::OnUnloadModule(Module* mod)
 {
        ServerInstance->PI->SendMetaData(NULL, "modules", "-" + mod->ModuleSourceFile);
 
+restart:
        unsigned int items = Utils->TreeRoot->ChildCount();
        for(unsigned int x = 0; x < items; x++)
        {
@@ -815,6 +816,8 @@ void ModuleSpanningTree::OnUnloadModule(Module* mod)
                {
                        sock->SendError("SSL module unloaded");
                        sock->Close();
+                       // XXX: The list we're iterating is modified by TreeSocket::Squit() which is called by Close()
+                       goto restart;
                }
        }