summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/users.cpp')
-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());
+ }
}
}