From d3b6538f955e824d46141f64fc081ce19fc081ef Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 21 Aug 2013 16:38:33 +0200 Subject: m_spanningtree When an IOHook goes away close all pending connections that use it --- src/modules/m_spanningtree/main.cpp | 7 +++++++ src/modules/m_spanningtree/utils.h | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 7c93e7d45..ce1792a02 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -815,6 +815,13 @@ void ModuleSpanningTree::OnUnloadModule(Module* mod) sock->Close(); } } + + for (SpanningTreeUtilities::TimeoutList::const_iterator i = Utils->timeoutlist.begin(); i != Utils->timeoutlist.end(); ++i) + { + TreeSocket* sock = i->first; + if (sock->GetIOHook() == mod) + sock->Close(); + } } // note: the protocol does not allow direct umode +o except diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h index 92a03428f..a0543b6bd 100644 --- a/src/modules/m_spanningtree/utils.h +++ b/src/modules/m_spanningtree/utils.h @@ -50,6 +50,8 @@ typedef std::map TreeServerList; class SpanningTreeUtilities : public classbase { public: + typedef std::map > TimeoutList; + /** Creator module */ ModuleSpanningTree* Creator; @@ -90,7 +92,7 @@ class SpanningTreeUtilities : public classbase server_hash sidlist; /** List of all outgoing sockets and their timeouts */ - std::map > timeoutlist; + TimeoutList timeoutlist; /** Holds the data from the tags in the conf */ std::vector > LinkBlocks; -- cgit v1.2.3