From 7775dc1be52c20fba05697521197742b5e288cb9 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 5 May 2007 11:56:39 +0000 Subject: Make debug warning for broken servers once per servername only git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6884 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/treesocket.h | 2 ++ src/modules/m_spanningtree/treesocket2.cpp | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index 15ca8f4cb..49c60ea13 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -96,6 +96,8 @@ class TreeSocket : public InspSocket std::string theirchallenge; /* Challenge recv for challenge/response */ std::string OutboundPass; /* Outbound password */ + static std::map warned; /* Server names that have had protocol violation warnings displayed for them */ + public: /** Because most of the I/O gubbins are encapsulated within diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 7a24ff84b..07f477264 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -1155,11 +1155,12 @@ bool TreeSocket::ProcessLine(std::string &line) userrec* x = Instance->FindNick(prefix); if (x) { - Instance->Log(DEFAULT, - "WARNING: I revceived modes '%s' from another server '%s'. This is not compliant with InspIRCd. Please check that server for bugs.", - params[1].c_str(), x->server); - Instance->SNO->WriteToSnoMask('d', "WARNING: The server %s is sending nonstandard modes: '%s MODE %s' and may cause desyncs.", - x->server, x->nick, params[1].c_str()); + if (warned.find(x->server) == warned.end()) + { + Instance->Log(DEFAULT,"WARNING: I revceived modes '%s' from another server '%s'. This is not compliant with InspIRCd. Please check that server for bugs.", params[1].c_str(), x->server); + Instance->SNO->WriteToSnoMask('d', "WARNING: The server %s is sending nonstandard modes: '%s MODE %s' where FMODE should be used, and may cause desyncs.", x->server, x->nick, params[1].c_str()); + warned[x->server] = x->nick; + } } } } -- cgit v1.2.3