aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_spanningtree/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree/main.cpp')
-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 ff8a7d9fc..4db9c9ce9 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -635,6 +635,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;
@@ -663,6 +672,8 @@ void ModuleSpanningTree::RemoteMessage(userrec* user, const char* format, ...)
Utils->DoOneToMany(ServerInstance->Config->ServerName, "PUSH", params);
}
}
+
+ SendingRemoteMessage = false;
}
int ModuleSpanningTree::HandleConnect(const char** parameters, int pcnt, userrec* user)