summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-08-21 16:38:33 +0200
committerattilamolnar <attilamolnar@hush.com>2013-08-21 16:38:33 +0200
commitd3b6538f955e824d46141f64fc081ce19fc081ef (patch)
tree603a1c76ad55a21c203e2351a06bd42139183660 /src/modules
parent3afddb6a34ec7be67d5e9f49de1919ac40770d73 (diff)
m_spanningtree When an IOHook goes away close all pending connections that use it
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_spanningtree/main.cpp7
-rw-r--r--src/modules/m_spanningtree/utils.h4
2 files changed, 10 insertions, 1 deletions
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<TreeServer*,TreeServer*> TreeServerList;
class SpanningTreeUtilities : public classbase
{
public:
+ typedef std::map<TreeSocket*, std::pair<std::string, int> > 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<TreeSocket*, std::pair<std::string, int> > timeoutlist;
+ TimeoutList timeoutlist;
/** Holds the data from the <link> tags in the conf
*/
std::vector<reference<Link> > LinkBlocks;