From 8f85458ff9cdfd0c677086e56492955ee89f6702 Mon Sep 17 00:00:00 2001 From: danieldg Date: Sat, 13 Feb 2010 21:47:13 +0000 Subject: 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 --- src/modules/m_spanningtree/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/modules/m_spanningtree/main.cpp') 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 p = i->second; std::map >::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); } } } -- cgit v1.3.1-10-gc9f91