]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/treesocket1.cpp
Link m_ldap against libldap_r
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / treesocket1.cpp
index 27d7b1a57746c68522f0dec784b582713d306a16..1a8bdd06c67055468a17ab301c6d338f12054d5f 100644 (file)
@@ -128,6 +128,7 @@ void TreeSocket::OnError(BufferedSocketError e)
        ServerInstance->SNO->WriteGlobalSno('l', "Connection to '\002%s\002' failed with error: %s",
                linkID.c_str(), getError().c_str());
        LinkState = DYING;
+       Close();
 }
 
 void TreeSocket::SendError(const std::string &errormessage)
@@ -153,12 +154,13 @@ CmdResult CommandSQuit::HandleServer(TreeServer* server, std::vector<std::string
                ret = CMD_FAILURE;
                server = server->GetParent();
        }
+       else if (quitting->GetParent() != server)
+               throw ProtocolException("Attempted to SQUIT a non-directly connected server or the parent");
 
        server->SQuitChild(quitting, params[1]);
 
        // XXX: Return CMD_FAILURE when servers SQUIT themselves (i.e. :00S SQUIT 00S :Shutting down)
-       // to avoid RouteCommand() being called. RouteCommand() requires a valid command source but we
-       // do not have one because the server user is deleted when its TreeServer is destructed.
+       // to stop this message from being forwarded.
        // The squit logic generates a SQUIT message with our sid as the source and sends it to the
        // remaining servers.
        return ret;