]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add loopCall to prevent double-broadcasting new X:lines
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 19 Apr 2009 15:26:21 +0000 (15:26 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 19 Apr 2009 15:26:21 +0000 (15:26 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11319 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_spanningtree/main.cpp
src/modules/m_spanningtree/main.h
src/modules/m_spanningtree/treesocket1.cpp

index 0a6ed9390c218810745d1eba153514f54d700d07..aabdba2bb0e4ff82d66ab149691cc63330c68cdf 100644 (file)
@@ -769,7 +769,7 @@ void ModuleSpanningTree::OnOper(User* user, const std::string &opertype)
 
 void ModuleSpanningTree::OnAddLine(User* user, XLine *x)
 {
-       if (!x->IsBurstable())
+       if (!x->IsBurstable() || loopCall)
                return;
 
        char data[MAXBUF];
index bac4f94a8b711ebfe485326f389ac542ca2da0e6..5333b64d46df2940d4df5fc4ff121fe2708d81e6 100644 (file)
@@ -51,6 +51,10 @@ class ModuleSpanningTree : public Module
 
  public:
        CacheRefreshTimer *RefreshTimer;
+       /** Set to true if inside a spanningtree call, to prevent sending
+        * xlines and other things back to their source
+        */
+       bool loopCall;
 
        /** Constructor
         */
index b34335b010f0e59c031391624cd3896965e8795e..12272d3b8e449ac5b4ad3087483591f5806b9c9b 100644 (file)
@@ -259,6 +259,7 @@ bool TreeSocket::OnDataReady()
        if (data && *data)
        {
                this->in_buffer.append(data);
+               Utils->Creator->loopCall = true;
                /* While there is at least one new line in the buffer,
                 * do something useful (we hope!) with it.
                 */
@@ -280,6 +281,7 @@ bool TreeSocket::OnDataReady()
                                return false;
                        }
                }
+               Utils->Creator->loopCall = false;
                return true;
        }
        /* EAGAIN returns an empty but non-NULL string, so this