diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-09-10 14:07:08 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-09-10 14:07:08 +0200 |
commit | 9d75ba35743eb8f44a2d7beb8e08aa43c13f5d2e (patch) | |
tree | d854533a0272a38a0fff0e9a35a508f7c43a7876 /src/modules/m_spanningtree/treesocket1.cpp | |
parent | 0a28c9dacb65ac46ee7dc3c6f42c81c0fc5b9de2 (diff) |
m_spanningtree Minor fixes
- Handle the case when servers SQUIT themselves
- Fix extra space in channel messages
Diffstat (limited to 'src/modules/m_spanningtree/treesocket1.cpp')
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index dc9bb5331..3c838177d 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -218,7 +218,13 @@ CmdResult CommandSQuit::HandleServer(TreeServer* server, std::vector<std::string TreeSocket* sock = server->GetSocket(); sock->Squit(quitting, params[1]); - return CMD_SUCCESS; + + // 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. + // We generate a SQUIT in TreeSocket::Squit(), with our sid as the source and send it to the + // remaining servers. + return ((quitting == server) ? CMD_FAILURE : CMD_SUCCESS); } /** This function is called when we receive data from a remote |