diff options
author | ChrisTX <chris@rev-crew.info> | 2012-08-09 01:49:32 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2012-08-10 17:04:07 +0200 |
commit | 9826eb515cd5097394a20ef66eba4e73448fbc08 (patch) | |
tree | ceec211820cc049e22ef9d211c84c8b53e64400b /src/modules | |
parent | a459f5b0e3e2ed219665feb7d3bc5d00d1643027 (diff) |
m_spanningtree: Resolve issue #250
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree/treesocket.h | 1 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 4 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index 13dfad3f1..aebc7e03b 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -94,6 +94,7 @@ class TreeSocket : public BufferedSocket time_t NextPing; /* Time when we are due to ping this server */ bool LastPingWasGood; /* Responded to last ping we sent? */ int proto_version; /* Remote protocol version */ + bool ConnectionFailureShown; /* Set to true if a connection failure message was shown */ public: time_t age; diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 7804c870d..75b4b0407 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -49,6 +49,7 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, Link* link, Autoconnect* mya capab->capab_phase = 0; MyRoot = NULL; proto_version = 0; + ConnectionFailureShown = false; LinkState = CONNECTING; if (!link->Hook.empty()) { @@ -78,6 +79,7 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, int newfd, ListenSocket* via age = ServerInstance->Time(); LinkState = WAIT_AUTH_1; proto_version = 0; + ConnectionFailureShown = false; linkID = "inbound from " + client->addr(); FOREACH_MOD(I_OnHookIO, OnHookIO(this, via)); diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index e6fbad4c6..0a0c22e39 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -484,13 +484,13 @@ void TreeSocket::Close() if (MyRoot) Squit(MyRoot,getError()); - if (!linkID.empty()) + if (!ConnectionFailureShown) { + ConnectionFailureShown = true; ServerInstance->SNO->WriteGlobalSno('l', "Connection to '\2%s\2' failed.",linkID.c_str()); time_t server_uptime = ServerInstance->Time() - this->age; if (server_uptime) ServerInstance->SNO->WriteGlobalSno('l', "Connection to '\2%s\2' was established for %s", linkID.c_str(), Utils->Creator->TimeToStr(server_uptime).c_str()); - linkID.clear(); } } |