diff options
author | attilamolnar <attilamolnar@hush.com> | 2012-07-05 22:22:50 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-07-08 16:15:57 +0200 |
commit | 33b908aedc61d2bce3dcf8f062d6522e3bd14dfa (patch) | |
tree | 47aa7b9b59db130ada83bb1a8eac9c8766066253 /src/modules/m_spanningtree | |
parent | c570f1d62bd5f371100f7ea02fedf0d7f04d41dd (diff) |
m_spanningtree Add function to easily determine whether a server was introduced to the network, use it to determine when to send SQUIT
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/treesocket.h | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index be5455bce..13dfad3f1 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -315,6 +315,10 @@ class TreeSocket : public BufferedSocket /** Handle server quit on close */ virtual void Close(); + + /** Returns true if this server was introduced to the rest of the network + */ + bool Introduced(); }; #endif diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index dcb35af31..7804c870d 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -183,7 +183,7 @@ void TreeSocket::Squit(TreeServer* Current, const std::string &reason) { DelServerEvent(Utils->Creator, Current->GetName()); - if (!Current->GetSocket() || Current->GetSocket()->GetLinkState() == CONNECTED) + if (!Current->GetSocket() || Current->GetSocket()->Introduced()) { parameterlist params; params.push_back(Current->GetName()); @@ -245,3 +245,8 @@ void TreeSocket::OnDataReady() SendError("RecvQ overrun (line too long)"); Utils->Creator->loopCall = false; } + +bool TreeSocket::Introduced() +{ + return (capab == NULL); +} |