From 06ce6ae763e33141e3c755b1f587b826501ed44a Mon Sep 17 00:00:00 2001 From: w00t Date: Tue, 5 Aug 2008 18:40:23 +0000 Subject: Not 100% tested, but this should fix the occasional 'anope+inspircd=my network is being ddos'd bug', reported by djGrrr, Namegduf, and others. git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@10098 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/treesocket1.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/modules/m_spanningtree/treesocket1.cpp') diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 2c7a96e6b..771708505 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -736,9 +736,10 @@ bool TreeSocket::ForceTopic(const std::string &source, std::deque & * dont bother to send the TOPIC command out, just silently * update the set time and set nick. */ + userrec* user = this->Instance->FindNick(source); + if (oldtopic != params[3]) { - userrec* user = this->Instance->FindNick(source); if (!user) { c->WriteChannelWithServ(Instance->Config->ServerName, "TOPIC %s :%s", c->name, c->topic); @@ -746,10 +747,23 @@ bool TreeSocket::ForceTopic(const std::string &source, std::deque & else { c->WriteChannel(user, "TOPIC %s :%s", c->name, c->topic); - nsource = user->server; } } + /* + * Take careful note of what happens here; + * Above, we display the topic change to the server IF the topic incoming is different to the topic already set. + * HERE, we find the server the user that sent this topic is on, so we *do not* send topics back to the link they just + * came from. This *cannot* be easily merged with the above check! + * + * Thanks to Anope and Namegduf for finally helping me isolate this + * -- w00t (5th/aug/2008) + */ + if (user) + { + nsource = user->server; + } + /* all done, send it on its way */ params[3] = ":" + params[3]; Utils->DoOneToAllButSender(source,"FTOPIC",params,nsource); -- cgit v1.3.1-10-gc9f91