summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-04 15:48:37 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-04 15:48:37 +0000
commitcf2a8bd3858b054acf8e4dfef28c6be637f43f89 (patch)
treefeb351a2f12c0e07e634a8647aedcfb5136a7782 /src/modules
parentd0617b10606c94121b72bdcc3ef4db5980571f0e (diff)
Attempt to avoid infinite loops
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9323 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_chanlog.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/m_chanlog.cpp b/src/modules/m_chanlog.cpp
index a5fcbe5bf..480d169d6 100644
--- a/src/modules/m_chanlog.cpp
+++ b/src/modules/m_chanlog.cpp
@@ -26,18 +26,24 @@ class ChannelLogStream : public LogStream
virtual void OnLog(int loglevel, const std::string &type, const std::string &msg)
{
Channel *c = ServerInstance->FindChan(channel);
+ static bool Logging = false;
printf("I got called\n");
if (loglevel < this->loglvl)
return;
+ if (Logging)
+ return;
+
if (c)
{
+ Logging = true; // this avoids (rare chance) loops with logging server IO on networks
char buf[MAXBUF];
snprintf(buf, MAXBUF, "\2%s\2: %s", type.c_str(), msg.c_str());
c->WriteChannelWithServ(ServerInstance->Config->ServerName, "PRIVMSG %s :%s", c->name, buf);
ServerInstance->PI->SendChannelPrivmsg(c, 0, buf);
+ Logging = false;
}
}
};