summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-24 00:34:13 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-24 00:34:13 +0000
commitf2dfc4be59bbf6aaad8fe4785e12e45d9296432a (patch)
tree01cad993da082f3d969f12f5c2ebaf3df1e8b231
parentf85fdf431e6ba24019315ab35d6fe0c76f24934f (diff)
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
-rw-r--r--src/users.cpp10
1 files 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());
+ }
}
}