summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-31 01:11:58 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-31 01:11:58 +0000
commitbd18fd54c0fbcbaaf624041c2288f26fce7941e3 (patch)
treec64aed614c10294408e9bd57451905ea25bfc5d5
parent56838d603daae6b196a4f58fe07f36c63164ba5a (diff)
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
-rw-r--r--src/modules/m_spanningtree/main.cpp11
1 files changed, 11 insertions, 0 deletions
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<std::string> 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)