diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-01 22:42:13 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-10-01 22:42:13 +0000 |
commit | 507e9554d69df3e2cee60fe52b02dc160c6e1602 (patch) | |
tree | c48571822fae75ac446b6bde88aca31a042901c1 /src/modules/m_spanningtree | |
parent | 75d9c67804196c2e4059f3ff89f2ed5ee79a175f (diff) |
Fix timeoutlist calling ConnectServer when not needed
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11792 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index a9fbff7c8..b0829cc1d 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -354,21 +354,26 @@ dupe_found:; void ModuleSpanningTree::DoConnectTimeout(time_t curtime) { std::vector<Autoconnect*> failovers; - for (std::map<TreeSocket*, std::pair<std::string, int> >::iterator i = Utils->timeoutlist.begin(); i != Utils->timeoutlist.end(); i++) + std::map<TreeSocket*, std::pair<std::string, int> >::iterator i = Utils->timeoutlist.begin(); + while (i != Utils->timeoutlist.end()) { TreeSocket* s = i->first; std::pair<std::string, int> p = i->second; + std::map<TreeSocket*, std::pair<std::string, int> >::iterator me = i; + i++; if (curtime > s->age + p.second) { ServerInstance->SNO->WriteToSnoMask('l',"CONNECT: Error connecting \002%s\002 (timeout of %d seconds)",p.first.c_str(),p.second); if (s->myautoconnect) failovers.push_back(s->myautoconnect); + Utils->timeoutlist.erase(me); s->Close(); } } - for(unsigned int i=0; i < failovers.size(); i++) + for(unsigned int j=0; j < failovers.size(); j++) { - ConnectServer(failovers[i]); + if (failovers[j]->position >= 0) + ConnectServer(failovers[j]); } } |