]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket2.cpp
Fix for bug #792 reported by recyclebin, do not attempt to ping local servers which...
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket2.cpp
index f35d3f6a5fa18920ba7bf4ae697a7c3f769be2d1..3e3fbd71e9e2e72b95c4a68f6c0dc7ba128ca999 100644 (file)
@@ -2,8 +2,8 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
@@ -180,21 +180,15 @@ bool TreeSocket::ProcessLine(std::string &line)
 
                                Node = new TreeServer(this->Utils, this->ServerInstance, InboundServerName, InboundDescription, InboundSID, Utils->TreeRoot, this, lnk ? lnk->Hidden : false);
 
-                               if (Node->DuplicateID())
-                               {
-                                       this->SendError("Server ID "+InboundSID+" already exists on the network!");
-                                       this->ServerInstance->SNO->WriteToSnoMask('l',"Server \2"+InboundServerName+"\2 being introduced from \2" + prefix + "\2 denied, server ID already exists on the network. Closing link.");
-                                       return false;
-                               }
-
                                Utils->TreeRoot->AddChild(Node);
-                               params.clear();
-                               params.push_back(InboundServerName);
-                               params.push_back("*");
-                               params.push_back("1");
-                               params.push_back(InboundSID);
-                               params.push_back(":"+InboundDescription);
-                               Utils->DoOneToAllButSender(ServerInstance->Config->GetSID(),"SERVER",params,InboundServerName);
+                               parameterlist sparams;
+                               sparams.push_back(InboundServerName);
+                               sparams.push_back("*");
+                               sparams.push_back("1");
+                               sparams.push_back(InboundSID);
+                               sparams.push_back(":"+InboundDescription);
+                               Utils->DoOneToAllButSender(ServerInstance->Config->GetSID(),"SERVER",sparams,InboundServerName);
+                               Utils->DoOneToAllButSenderRaw(line, InboundServerName, prefix, command, params);
                                Node->bursting = true;
                                this->DoBurst(Node);
                        }
@@ -250,7 +244,7 @@ bool TreeSocket::ProcessLine(std::string &line)
                                 * "miscreant" servers, though, so let's check anyway. -- w
                                 *
                                 * We also check here for totally invalid prefixes (prefixes that are neither
-                                * a valid SID or a valid UUID, so that invalid UUID or SID never makes it 
+                                * a valid SID or a valid UUID, so that invalid UUID or SID never makes it
                                 * to the higher level functions. -- B
                                 */
                                std::string direction = prefix;
@@ -445,13 +439,24 @@ bool TreeSocket::ProcessLine(std::string &line)
                                if (params.size() == 3)
                                {
                                        TreeServer* pf = Utils->FindServer(prefix);
-                                       User* user = this->ServerInstance->FindNick(params[1]);
-                                       Channel* chan = this->ServerInstance->FindChan(params[0]);
-                                       if (pf && user && chan)
+                                       if (pf)
                                        {
-                                               if (!chan->ServerKickUser(user, params[2].c_str(), false, pf->GetName().c_str()))
-                                                       /* Yikes, the channels gone! */
-                                                       delete chan;
+                                               irc::commasepstream nicks(params[1]);
+                                               std::string nick;
+                                               Channel* chan = this->ServerInstance->FindChan(params[0]);
+                                               if (chan)
+                                               {
+                                                       while (nicks.GetToken(nick))
+                                                       {
+                                                               User* user = this->ServerInstance->FindNick(nick);
+                                                               if (user)
+                                                               {
+                                                                       if (!chan->ServerKickUser(user, params[2].c_str(), false, pf->GetName().c_str()))
+                                                                               /* Yikes, the channels gone! */
+                                                                               delete chan;
+                                                               }
+                                                       }
+                                               }
                                        }
                                }
 
@@ -592,9 +597,9 @@ bool TreeSocket::ProcessLine(std::string &line)
                                                if (collideret != 1)
                                                {
                                                        /*
-                                                        * Remote client lost, or both lost, parsing this nickchange would be
-                                                        * pointless, as the incoming client's server will soon recieve SVSNICK to
-                                                        * change its nick to its UID. :) -- w00t
+                                                        * Remote client lost, or both lost, parsing or passing on this
+                                                        * nickchange would be pointless, as the incoming client's server will
+                                                        * soon recieve SVSNICK to change its nick to its UID. :) -- w00t
                                                         */
                                                        return true;
                                                }
@@ -683,5 +688,3 @@ void TreeSocket::OnClose()
                                this->ServerInstance->SNO->WriteToSnoMask('l', "Connection to '\2%s\2' was established for %s", quitserver.c_str(), Utils->Creator->TimeToStr(server_uptime).c_str());
        }
 }
-
-