From f2dfc4be59bbf6aaad8fe4785e12e45d9296432a Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 24 Dec 2006 00:34:13 +0000 Subject: [PATCH] Fix loop when quitting multiple users (this is probably whats eating cpu) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6084 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/users.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/users.cpp b/src/users.cpp index 712214100..c8f5bf927 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1996,13 +1996,14 @@ void userrec::ShowRULES() void userrec::HandleEvent(EventType et, int errornum) { /* WARNING: May delete this user! */ + int thisfd = this->GetFd(); + try { switch (et) { case EVENT_READ: ServerInstance->ProcessUser(this); - return; break; case EVENT_WRITE: this->FlushWriteBuf(); @@ -2019,9 +2020,12 @@ void userrec::HandleEvent(EventType et, int errornum) } /* If the user has raised an error whilst being processed, quit them now we're safe to */ - if (!WriteError.empty()) + if ((ServerInstance->SE->GetRef(thisfd) == this)) { - userrec::QuitUser(ServerInstance, this, GetWriteError()); + if (!WriteError.empty()) + { + userrec::QuitUser(ServerInstance, this, GetWriteError()); + } } } -- 2.39.5