NetSendToAll(buffer);
}
+ user->FlushWriteBuf();
+
FOREACH_MOD OnUserDisconnect(user);
if (user->fd > -1)
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())
{
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);