summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-07-28 14:21:20 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-07-28 14:21:20 +0200
commitcd330c4bc5ae3e2e89a5c02a031ffd90292e94f1 (patch)
tree83ef3265d1675b5aa27fc92a653e94fc5c97d750 /src
parent3c810a7af5f568ae870c4439b5ea2a4d89fa7d01 (diff)
m_spanningtree Ensure that TreeSocket::Close() only runs once
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index 25cc751e4..7e26a325e 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -344,8 +344,10 @@ void TreeSocket::OnTimeout()
void TreeSocket::Close()
{
- if (fd != -1)
- ServerInstance->GlobalCulls.AddItem(this);
+ if (fd < 0)
+ return;
+
+ ServerInstance->GlobalCulls.AddItem(this);
this->BufferedSocket::Close();
SetError("Remote host closed connection");