diff options
author | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-15 10:15:18 +0000 |
---|---|---|
committer | peavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-15 10:15:18 +0000 |
commit | 729e71cad44944f78c9d80bc7c2a93e305543269 (patch) | |
tree | 4ab632b54a2c0750c47a1c1184ea752cbb38fb92 | |
parent | 02c6ce1ad09a7471a6b03dc00bac4b843d157489 (diff) |
And truly fix rsquit 1 parm crash.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7331 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_spanningtree/rsquit.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/modules/m_spanningtree/rsquit.cpp b/src/modules/m_spanningtree/rsquit.cpp index 86ba4d306..73b31d511 100644 --- a/src/modules/m_spanningtree/rsquit.cpp +++ b/src/modules/m_spanningtree/rsquit.cpp @@ -61,13 +61,13 @@ CmdResult cmd_rsquit::Handle (const char** parameters, int pcnt, userrec *user) { if (ServerInstance->MatchText(ServerInstance->Config->ServerName,parameters[0])) { - if (s == Utils->TreeRoot) - { - NoticeUser(user, "*** RSQUIT: Foolish mortal, you cannot make a server SQUIT itself! ("+ConvToStr(parameters[1])+" matches local server name)"); - return CMD_FAILURE; - } if (s) { + if (s == Utils->TreeRoot) + { + NoticeUser(user, "*** RSQUIT: Foolish mortal, you cannot make a server SQUIT itself! ("+ConvToStr(parameters[1])+" matches local server name)"); + return CMD_FAILURE; + } TreeSocket* sock = s->GetSocket(); if (!sock) { @@ -84,19 +84,22 @@ CmdResult cmd_rsquit::Handle (const char** parameters, int pcnt, userrec *user) } else { - if (s == Utils->TreeRoot) - { - NoticeUser(user, "*** RSQUIT: Foolish mortal, you cannot make a server SQUIT itself! ("+ConvToStr(parameters[0])+" matches local server name)"); - return CMD_FAILURE; - } - TreeSocket* sock = s->GetSocket(); - if (sock) + if (s) { - ServerInstance->SNO->WriteToSnoMask('l',"RSQUIT: Server \002%s\002 removed from network by %s",parameters[0],user->nick); - sock->Squit(s,std::string("Server quit by ") + user->GetFullRealHost()); - ServerInstance->SE->DelFd(sock); - sock->Close(); - delete sock; + if (s == Utils->TreeRoot) + { + NoticeUser(user, "*** RSQUIT: Foolish mortal, you cannot make a server SQUIT itself! ("+ConvToStr(parameters[0])+" matches local server name)"); + return CMD_FAILURE; + } + TreeSocket* sock = s->GetSocket(); + if (sock) + { + ServerInstance->SNO->WriteToSnoMask('l',"RSQUIT: Server \002%s\002 removed from network by %s",parameters[0],user->nick); + sock->Squit(s,std::string("Server quit by ") + user->GetFullRealHost()); + ServerInstance->SE->DelFd(sock); + sock->Close(); + delete sock; + } } } |