diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-13 21:47:13 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-13 21:47:13 +0000 |
commit | 8f85458ff9cdfd0c677086e56492955ee89f6702 (patch) | |
tree | a0d5108af6c7932af93c5befe1ed699d88092f75 /src/modules/m_spanningtree/main.cpp | |
parent | 7d075564787cbde9bf05aca8b1cd5b10ea978c05 (diff) |
Clean up treesocket naming confusion by adding a link block reference during negotiation
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12452 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/main.cpp')
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index ee2118915..11b309557 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -277,8 +277,7 @@ void ModuleSpanningTree::ConnectServer(Link* x, Autoconnect* y) if (ipvalid) { /* Gave a hook, but it wasnt one we know */ - TreeSocket* newsocket = new TreeSocket(Utils, x->IPAddr, x->Port, x->Timeout ? x->Timeout : 10, - x->Name.c_str(), x->Bind, y, x->Hook); + TreeSocket* newsocket = new TreeSocket(Utils, x, y, x->IPAddr); if (newsocket->GetFd() > -1) { /* Handled automatically on success */ @@ -328,12 +327,16 @@ void ModuleSpanningTree::DoConnectTimeout(time_t curtime) std::pair<std::string, int> p = i->second; std::map<TreeSocket*, std::pair<std::string, int> >::iterator me = i; i++; + if (s->GetLinkState() == DYING) + { + Utils->timeoutlist.erase(me); + s->Close(); + } 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); Utils->timeoutlist.erase(me); s->Close(); - ServerInstance->GlobalCulls.AddItem(s); } } } |