diff options
-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 |