From c039ac13e29beabd84f884f3cc4530705330c4c4 Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 9 Jan 2006 00:15:50 +0000 Subject: m_park.cpp fixes (and anything else using UserToPseudo and PesudoToUser) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2741 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules.cpp b/src/modules.cpp index d76f20f5f..ca9808ef5 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -598,9 +598,10 @@ int Server::CountUsers(chanrec* c) bool Server::UserToPseudo(userrec* user,std::string message) { unsigned int old_fd = user->fd; - user->fd = FD_MAGIC_NUMBER; - user->ClearBuffer(); Write(old_fd,"ERROR :Closing link (%s@%s) [%s]",user->ident,user->host,message.c_str()); + user->FlushWriteBuf(); + user->ClearBuffer(); + user->fd = FD_MAGIC_NUMBER; ServerInstance->SE->DelFd(old_fd); shutdown(old_fd,2); close(old_fd); @@ -611,6 +612,7 @@ bool Server::PseudoToUser(userrec* alive,userrec* zombie,std::string message) { zombie->fd = alive->fd; alive->fd = FD_MAGIC_NUMBER; + alive->FlushWriteBuf(); alive->ClearBuffer(); Write(zombie->fd,":%s!%s@%s NICK %s",alive->nick,alive->ident,alive->host,zombie->nick); kill_link(alive,message.c_str()); -- cgit v1.2.3