]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Optimisations
[user/henk/code/inspircd.git] / src / users.cpp
index 0620a9e0c2c7d49d2939731b753f27f55eee8950..e67ad7cecce5ea65190a2ac5a06566652441e085 100644 (file)
@@ -437,8 +437,18 @@ void DeleteOper(userrec* user)
 void kill_link(userrec *user,const char* r)
 {
         user_hash::iterator iter = clientlist.find(user->nick);
-       if (iter == clientlist.end())
-               return;
+
+
+/*
+ * I'm pretty sure returning here is causing a desync when part of the net thinks a user is gone,
+ * and another part doesn't. We want to broadcast the quit/kill before bailing so the net stays in sync.
+ *
+ * I can't imagine this blowing up, so I'm commenting it out. We still check
+ * before playing with a bad iterator below in our if(). DISCUSS THIS BEFORE YOU DO ANYTHING. --w00t
+ *
+ *     if (iter == clientlist.end())
+ *             return;
+ */
 
         char reason[MAXBUF];
 
@@ -454,7 +464,8 @@ void kill_link(userrec *user,const char* r)
                 WriteCommonExcept(user,"QUIT :%s",reason);
         }
 
-        user->FlushWriteBuf();
+       if (IS_LOCAL(user))
+               user->FlushWriteBuf();
 
         FOREACH_MOD(I_OnUserDisconnect,OnUserDisconnect(user));