diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-04-19 15:26:21 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-04-19 15:26:21 +0000 |
commit | 520401ed4a472f062f3e4bcef038905169f53c17 (patch) | |
tree | ceb9d7291e2ac8af36969c44d17286bd85805608 /src/modules | |
parent | 1f75c5c20a8733cd0f9a9851a91482fd4f503075 (diff) |
Add loopCall to prevent double-broadcasting new X:lines
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11319 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.h | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 0a6ed9390..aabdba2bb 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -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]; diff --git a/src/modules/m_spanningtree/main.h b/src/modules/m_spanningtree/main.h index bac4f94a8..5333b64d4 100644 --- a/src/modules/m_spanningtree/main.h +++ b/src/modules/m_spanningtree/main.h @@ -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 */ diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index b34335b01..12272d3b8 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -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 |