From bd18fd54c0fbcbaaf624041c2288f26fce7941e3 Mon Sep 17 00:00:00 2001 From: special Date: Fri, 31 Aug 2007 01:11:58 +0000 Subject: Fixed a bug introduced in r7827 (does not affect 1.1.12) that would cause an infinite loop for some spanningtree link errors. Found by danieldg git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8003 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 07a2f5ea3..6d71fc872 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -629,6 +629,15 @@ int ModuleSpanningTree::HandleVersion(const char** parameters, int pcnt, userrec */ void ModuleSpanningTree::RemoteMessage(userrec* user, const char* format, ...) { + /* This could cause an infinite loop, because DoOneToMany() will, on error, + * call TreeSocket::OnError(), which in turn will call this function to + * notify everyone of the error. So, drop any messages that are generated + * during the sending of another message. -Special */ + static bool SendingRemoteMessage = false; + if (SendingRemoteMessage) + return; + SendingRemoteMessage = true; + std::deque params; char text[MAXBUF]; va_list argsPtr; @@ -657,6 +666,8 @@ void ModuleSpanningTree::RemoteMessage(userrec* user, const char* format, ...) Utils->DoOneToMany(ServerInstance->Config->GetSID(), "PUSH", params); } } + + SendingRemoteMessage = false; } int ModuleSpanningTree::HandleConnect(const char** parameters, int pcnt, userrec* user) -- cgit v1.2.3