From e381b06561228aaea752deda20a62c6dc99a560e Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 18 Aug 2006 01:08:14 +0000 Subject: EventHandler class, an abstraction for raw i/o git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4941 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_quit.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/cmd_quit.cpp') diff --git a/src/cmd_quit.cpp b/src/cmd_quit.cpp index 7430e0fd2..c1e73bc84 100644 --- a/src/cmd_quit.cpp +++ b/src/cmd_quit.cpp @@ -52,7 +52,7 @@ void cmd_quit::Handle (const char** parameters, int pcnt, userrec *user) /* We should only prefix the quit for a local user. Remote users have * already been prefixed, where neccessary, by the upstream server. */ - if (user->fd > -1) + if (IS_LOCAL(user)) { user->Write("ERROR :Closing link (%s@%s) [%s%s]",user->ident,user->host,ServerInstance->Config->PrefixQuit,parameters[0]); ServerInstance->WriteOpers("*** Client exiting: %s!%s@%s [%s%s]",user->nick,user->ident,user->host,ServerInstance->Config->PrefixQuit,parameters[0]); @@ -80,9 +80,9 @@ void cmd_quit::Handle (const char** parameters, int pcnt, userrec *user) FOREACH_MOD(I_OnUserDisconnect,OnUserDisconnect(user)); /* push the socket on a stack of sockets due to be closed at the next opportunity */ - if (user->fd > -1) + if (IS_LOCAL(user)) { - ServerInstance->SE->DelFd(user->fd); + ServerInstance->SE->DelFd(user); if (find(ServerInstance->local_users.begin(),ServerInstance->local_users.end(),user) != ServerInstance->local_users.end()) { ServerInstance->Log(DEBUG,"Delete local user"); @@ -99,7 +99,6 @@ void cmd_quit::Handle (const char** parameters, int pcnt, userrec *user) if (user->registered == REG_ALL) { user->PurgeEmptyChannels(); } - if (user->fd > -1) - ServerInstance->fd_ref_table[user->fd] = NULL; DELETE(user); } + -- cgit v1.2.3