diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_spanningtree/treesocket.h | 5 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index 1bd02762d..4438b473d 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -49,10 +49,11 @@ * WAIT_AUTH_2: indicates that the socket is inbound * but has not yet sent and received * SERVER strings. - * CONNECTED: represents a fully authorized, fully + * CONNECTED: represents a fully authorized, fully * connected server. + * DYING: represents a server that has had an error. */ -enum ServerState { CONNECTING, WAIT_AUTH_1, WAIT_AUTH_2, CONNECTED }; +enum ServerState { CONNECTING, WAIT_AUTH_1, WAIT_AUTH_2, CONNECTED, DYING }; struct CapabData { diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 23d1e46cd..ea87c615f 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -143,6 +143,8 @@ void TreeSocket::OnError(BufferedSocketError e) void TreeSocket::SendError(const std::string &errormessage) { WriteLine("ERROR :"+errormessage); + DoWrite(); + LinkState = DYING; SetError(errormessage); } @@ -233,7 +235,7 @@ void TreeSocket::OnDataReady() if (!getError().empty()) break; } - if (getError().empty() && recvq.length() > 4096) + if (LinkState != CONNECTED && recvq.length() > 4096) SendError("RecvQ overrun (line too long)"); Utils->Creator->loopCall = false; } diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 3f63da03d..aacbbc25f 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -219,6 +219,8 @@ void TreeSocket::ProcessLine(std::string &line) */ this->ProcessConnectedLine(prefix, command, params); break; + case DYING: + break; } } |