From e5c8ee880b8d122abded2aee54d25641db5e3d4f Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 30 Jun 2006 17:54:48 +0000 Subject: [PATCH] *** Interesting fix *** When a remote kill occurs, the user record for the remotely killed user may still hang around in the servers user list which is used when removing users during a netsplit. I managed to duplicate the old 'crash on netsplit' bug by sending a remote kill to a server, and then squitting that server without receipt of the corresponding QUIT. The fix now removes the user record explicitly upon remote kill (this also includes collisions) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4088 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 44786923c..dc50140b2 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -2622,6 +2622,11 @@ class TreeSocket : public InspSocket userrec* y = Srv->FindNick(prefix); if (y) { + TreeServer* n = FindServer(y->server); + if (n) + { + n->DelUser(y); + } Srv->QuitUser(y,"Nickname collision"); } return DoOneToAllButSenderRaw(line,sourceserv,prefix,command,params); @@ -3740,6 +3745,17 @@ class ModuleSpanningTree : public Module params.push_back(dest->nick); params.push_back(":"+reason); DoOneToMany(source->nick,"KILL",params); + /* NOTE: We must remove the user from the servers list here. + * If we do not, there is a chance the user could hang around + * in the list if there is a desync for example (this would + * not be good). + * Part of the 'random crash on netsplit' tidying up. -Brain + */ + TreeServer* n = FindServer(dest->server); + if (n) + { + n->DelUser(dest); + } } virtual void OnRehash(const std::string ¶meter) -- 2.39.5