diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-01-16 09:14:23 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-01-16 09:14:23 +0000 |
commit | 72fe978b29fa7d9fd7f8e9c2766c06ab1a0a8bc7 (patch) | |
tree | c870f41d2c416cfb8c298177480c58434a4ee990 | |
parent | 32026e5b6f345be8bfeddde939e69eec6618fe6b (diff) |
Two stage commit: don't set user->muted except in QuitUser (duplicate setting), also, change muted to drop all socket operations instead of just not reading the user's buffer if muted is set (no point wasting time - they're going away). Also revert culllist back to once per mainloop iteration now it is much cheaper than previously.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8716 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/users.h | 8 | ||||
-rw-r--r-- | src/command_parse.cpp | 8 | ||||
-rw-r--r-- | src/commands/cmd_kill.cpp | 1 | ||||
-rw-r--r-- | src/inspircd.cpp | 6 | ||||
-rw-r--r-- | src/userprocess.cpp | 2 | ||||
-rw-r--r-- | src/users.cpp | 5 |
6 files changed, 13 insertions, 17 deletions
diff --git a/include/users.h b/include/users.h index 4d7b074b6..a452ec014 100644 --- a/include/users.h +++ b/include/users.h @@ -632,11 +632,11 @@ class CoreExport User : public connection */ time_t reset_due; - /** If this is set to true, then all read operations for the user + /** If this is set to true, then all socket operations for the user * are dropped into the bit-bucket. - * This is used by the global CullList, but please note that setting this value - * alone will NOT cause the user to quit. This means it can be used seperately, - * for example by shun modules etc. + * This value is set by QuitUser, and is not needed seperately from that call. + * Please note that setting this value alone will NOT cause the user to quit. + * This means it can be used seperately, for example by shun modules etc. */ bool muted; diff --git a/src/command_parse.cpp b/src/command_parse.cpp index d82f523db..82209015c 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -413,12 +413,10 @@ bool CommandParser::ProcessBuffer(std::string &buffer,User *user) if (buffer.length()) { - if (!user->muted) - { - ServerInstance->Log(DEBUG,"C[%d] I :%s %s",user->GetFd(), user->nick, buffer.c_str()); - return this->ProcessCommand(user,buffer); - } + ServerInstance->Log(DEBUG,"C[%d] I :%s %s",user->GetFd(), user->nick, buffer.c_str()); + return this->ProcessCommand(user,buffer); } + return true; } diff --git a/src/commands/cmd_kill.cpp b/src/commands/cmd_kill.cpp index 9b4dbbf1a..675532a3c 100644 --- a/src/commands/cmd_kill.cpp +++ b/src/commands/cmd_kill.cpp @@ -98,7 +98,6 @@ CmdResult CommandKill::Handle (const char** parameters, int pcnt, User *user) user->dhost, *ServerInstance->Config->HideKillsServer ? ServerInstance->Config->HideKillsServer : user->nick, parameters[1]); - u->muted = true; } } diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 8b56706dd..9318a03fd 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -625,9 +625,6 @@ int InspIRCd::Run() */ if (TIME != OLDTIME) { - /* if any users were quit, take them out */ - this->GlobalCulls.Apply(); - if (TIME < OLDTIME) { WriteOpers("*** \002EH?!\002 -- Time is flowing BACKWARDS in this dimension! Clock drifted backwards %d secs.",abs(OLDTIME-TIME)); @@ -677,6 +674,9 @@ int InspIRCd::Run() */ this->SE->DispatchEvents(); + /* if any users were quit, take them out */ + this->GlobalCulls.Apply(); + /* If any inspsockets closed, remove them */ this->BufferedSocketCull(); diff --git a/src/userprocess.cpp b/src/userprocess.cpp index 7a1938d2c..5ec2581f7 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -190,7 +190,6 @@ void InspIRCd::DoBackgroundUserStuff() * registration timeout -- didnt send USER/NICK/HOST * in the time specified in their connection class. */ - curr->muted = true; User::QuitUser(this, curr, "Registration timeout"); continue; } @@ -220,7 +219,6 @@ void InspIRCd::DoBackgroundUserStuff() time_t time = this->Time(false) - (curr->nping - curr->MyClass->GetPingTime()); char message[MAXBUF]; snprintf(message, MAXBUF, "Ping timeout: %ld second%s", (long)time, time > 1 ? "s" : ""); - curr->muted = true; curr->lastping = 1; curr->nping = TIME + curr->MyClass->GetPingTime(); User::QuitUser(this, curr, message); diff --git a/src/users.cpp b/src/users.cpp index f2c2d9ae4..538f8d33b 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -785,7 +785,6 @@ void User::FullConnect() if (r) { - this->muted = true; r->Apply(this); return; } @@ -794,7 +793,6 @@ void User::FullConnect() if (n) { - this->muted = true; n->Apply(this); return; } @@ -1702,6 +1700,9 @@ void User::ShowRULES() void User::HandleEvent(EventType et, int errornum) { + if (this->muted) // drop everything, user is due to be quit + return; + /* WARNING: May delete this user! */ int thisfd = this->GetFd(); |