]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add DYING link state, push error messages on link, and only limit recvq on unauthenti...
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 4 Feb 2010 00:47:40 +0000 (00:47 +0000)
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 4 Feb 2010 00:47:40 +0000 (00:47 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12370 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_spanningtree/treesocket.h
src/modules/m_spanningtree/treesocket1.cpp
src/modules/m_spanningtree/treesocket2.cpp

index 1bd02762d5db2eb2bef1f05a7c86e40b19d04e98..4438b473d3298a316bfb146eb89b7816cfdd6679 100644 (file)
  * WAIT_AUTH_2:        indicates that the socket is inbound
  *                                                     but has not yet sent and received
  *                                                     SERVER strings.
  * 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.
  *                                                     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
 {
 
 struct CapabData
 {
index 23d1e46cdfa01b8afbf7586cc62e14f1265ea9f0..ea87c615fb9a989bd32f743269d662d06b8db6fc 100644 (file)
@@ -143,6 +143,8 @@ void TreeSocket::OnError(BufferedSocketError e)
 void TreeSocket::SendError(const std::string &errormessage)
 {
        WriteLine("ERROR :"+errormessage);
 void TreeSocket::SendError(const std::string &errormessage)
 {
        WriteLine("ERROR :"+errormessage);
+       DoWrite();
+       LinkState = DYING;
        SetError(errormessage);
 }
 
        SetError(errormessage);
 }
 
@@ -233,7 +235,7 @@ void TreeSocket::OnDataReady()
                if (!getError().empty())
                        break;
        }
                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;
 }
                SendError("RecvQ overrun (line too long)");
        Utils->Creator->loopCall = false;
 }
index 3f63da03d6c30643abcd1bae61dc9429b6a81504..aacbbc25f68b9a52b5bc576b3b7e6efb90f94a7b 100644 (file)
@@ -219,6 +219,8 @@ void TreeSocket::ProcessLine(std::string &line)
                         */
                        this->ProcessConnectedLine(prefix, command, params);
                break;
                         */
                        this->ProcessConnectedLine(prefix, command, params);
                break;
+               case DYING:
+               break;
        }
 }
 
        }
 }