From 7f0a9608c895bf437f746cbca16d9fbad158b782 Mon Sep 17 00:00:00 2001 From: danieldg Date: Thu, 11 Feb 2010 16:07:52 +0000 Subject: Restart server_hash iteration after quitting dead and pinged out servers git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12435 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/main.cpp | 4 +++- src/modules/m_spanningtree/treesocket1.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/modules/m_spanningtree') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index e744b675a..3e5e2beb9 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -147,6 +147,7 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime) */ long ts = ServerInstance->Time() * 1000 + (ServerInstance->Time_ns() / 1000000); +restart: for (server_hash::iterator i = Utils->serverlist.begin(); i != Utils->serverlist.end(); i++) { TreeServer *s = i->second; @@ -156,6 +157,7 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime) s->GetSocket()->SendError("Ping timeout"); s->GetSocket()->Squit(s,"Ping timeout"); s->GetSocket()->Close(); + goto restart; } // Fix for bug #792, do not ping servers that are not connected yet! @@ -196,7 +198,7 @@ void ModuleSpanningTree::DoPingChecks(time_t curtime) sock->SendError("Ping timeout"); sock->Squit(s,"Ping timeout"); sock->Close(); - return; + goto restart; } } } diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index ea87c615f..5efa58f3b 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -137,7 +137,7 @@ void TreeSocket::OnError(BufferedSocketError e) { ServerInstance->SNO->WriteGlobalSno('l', "Connection to \002%s\002 failed with error: %s", myhost.c_str(), getError().c_str()); - ServerInstance->GlobalCulls.AddItem(this); + LinkState = DYING; } void TreeSocket::SendError(const std::string &errormessage) -- cgit v1.2.3