]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
I gots a better fix :p
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 17 Feb 2008 00:26:15 +0000 (00:26 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 17 Feb 2008 00:26:15 +0000 (00:26 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8951 e03df62e-2008-0410-955e-edbf42e46eb7

include/xline.h
src/modules/m_spanningtree/netburst.cpp
src/xline.cpp

index d5653f8e0558b16b9913fdadc369198439389e5c..6d11256f21a170d36a773764e2bd086fbadd44d3 100644 (file)
@@ -142,6 +142,8 @@ class CoreExport XLine : public classbase
         * type of line this is.
         */
        const std::string type;
+
+       virtual bool IsBurstable();
 };
 
 /** KLine class
@@ -184,6 +186,8 @@ class CoreExport KLine : public XLine
 
        virtual const char* Displayable();
 
+       virtual bool IsBurstable();
+
        /** Ident mask (ident part only)
         */
        char* identmask;
index e9366ef7197b39d6fdd1981d87f86fe3770acc8e..86d13e96f285a383d04b947ece3c34d44724170b 100644 (file)
@@ -164,8 +164,11 @@ void TreeSocket::SendXLines(TreeServer* Current)
                {
                        for (LookupIter i = lookup->begin(); i != lookup->end(); ++i)
                        {
-                               if (i->second->type == "K")
-                                       continue;
+                               /* Is it burstable? this is better than an explicit check for type 'K'.
+                                * We break the loop as NONE of the items in this group are worth iterating.
+                                */
+                               if (!i->second->IsBurstable())
+                                       break;
 
                                snprintf(data,MAXBUF,":%s ADDLINE %s %s %s %lu %lu :%s\r\n",sn, it->c_str(), i->second->Displayable(),
                                                i->second->source,
index 57e6221c42ffcf419151202a371d357f1e74e7a8..547a54fea6ed564ced89b8f442333627338cae2e 100644 (file)
@@ -391,6 +391,11 @@ void XLine::Apply(User* u)
 {
 }
 
+bool XLine::IsBurstable()
+{
+       return true;
+}
+
 void XLine::DefaultApply(User* u, const std::string &line, bool bancache)
 {
        char sreason[MAXBUF];
@@ -595,6 +600,11 @@ const char* QLine::Displayable()
        return nick;
 }
 
+bool KLine::IsBurstable()
+{
+       return false;
+}
+
 bool XLineManager::RegisterFactory(XLineFactory* xlf)
 {
        XLineFactMap::iterator n = line_factory.find(xlf->GetType());