From 20d467e5a5473577c0e04b63edecdbbbef7ec9c2 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 10 Dec 2006 19:49:49 +0000 Subject: Correctly handle write events git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5920 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/userprocess.cpp | 6 ------ src/users.cpp | 8 ++++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/userprocess.cpp b/src/userprocess.cpp index b738c8096..43edb56b1 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -333,13 +333,7 @@ void InspIRCd::DoBackgroundUserStuff(time_t TIME) */ curr->FlushWriteBuf(); - if (*curr->GetWriteError()) - { - GlobalGoners.AddItem(curr,curr->GetWriteError()); - continue; - } } - } /* If theres nothing to do, trigger in the next second, something might come up */ diff --git a/src/users.cpp b/src/users.cpp index 0d6b0d990..b568bac63 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -673,7 +673,10 @@ void userrec::FlushWriteBuf() this->ServerInstance->SE->WantWrite(this); } else - this->SetWriteError(strerror(errno)); + { + this->QuitUser(ServerInstance, this, strerror(errno)); + return; + } } else { @@ -786,9 +789,6 @@ void userrec::QuitUser(InspIRCd* Instance, userrec *user, const std::string &qui user->WriteCommonExcept("QUIT :%s",reason.c_str()); } - if (IS_LOCAL(user)) - user->FlushWriteBuf(); - FOREACH_MOD_I(Instance,I_OnUserDisconnect,OnUserDisconnect(user)); if (IS_LOCAL(user)) -- cgit v1.2.3