diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-19 21:14:28 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-19 21:14:28 +0000 |
commit | f331d502c001b6a394599c319d197505c91a71f1 (patch) | |
tree | 34320248d7dd0caca6e49af36a1df233a7e590fb | |
parent | fbb355da2cbdf283f450206f6b8642fa0d08f6e9 (diff) |
Kill fixes
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1454 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/inspircd.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index b026723a0..3de9ede89 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -1081,6 +1081,8 @@ void kill_link(userrec *user,const char* r) NetSendToAll(buffer); } + user->FlushWriteBuf(); + FOREACH_MOD OnUserDisconnect(user); if (user->fd > -1) @@ -1108,15 +1110,14 @@ void kill_link(userrec *user,const char* r) shutdown(user->fd,2); close(user->fd); } - - if (user->registered == 7) { - WriteOpers("*** Client exiting: %s!%s@%s [%s]",user->nick,user->ident,user->host,reason); - AddWhoWas(user); - } + // this must come before the WriteOpers so that it doesnt try to fill their buffer with anything + // if they were an oper with +s. if (user->registered == 7) { purge_empty_chans(user); - } + WriteOpers("*** Client exiting: %s!%s@%s [%s]",user->nick,user->ident,user->host,reason); + AddWhoWas(user); + } if (iter != clientlist.end()) { @@ -1145,6 +1146,8 @@ void kill_link_silent(userrec *user,const char* r) Write(user->fd,"ERROR :Closing link (%s@%s) [%s]",user->ident,user->host,reason); log(DEBUG,"closing fd %lu",(unsigned long)user->fd); + user->FlushWriteBuf(); + if (user->registered == 7) { FOREACH_MOD OnUserQuit(user); WriteCommonExcept(user,"QUIT :%s",reason); |