From 6fe52cbb3ba72a5ecdded3f51c8515bf75e6801f Mon Sep 17 00:00:00 2001 From: danieldg Date: Sun, 25 Oct 2009 15:21:45 +0000 Subject: Fixes found by removing User inheritance from StreamSocket git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11975 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/usermanager.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/usermanager.cpp') diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 06d6ad1cd..f620a264d 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -195,13 +195,14 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char if (IS_LOCAL(user)) { - FOREACH_MOD(I_OnUserDisconnect,OnUserDisconnect(IS_LOCAL(user))); - user->DoWrite(); - if (user->GetIOHook()) + LocalUser* lu = IS_LOCAL(user); + FOREACH_MOD(I_OnUserDisconnect,OnUserDisconnect(lu)); + lu->DoWrite(); + if (lu->GetIOHook()) { try { - user->GetIOHook()->OnStreamSocketClose(user); + lu->GetIOHook()->OnStreamSocketClose(lu); } catch (CoreException& modexcept) { @@ -209,10 +210,8 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char } } - ServerInstance->SE->DelFd(user); - user->Close(); - // user->Close() will set fd to -1; this breaks IS_LOCAL. Fix - user->SetFd(INT_MAX); + ServerInstance->SE->DelFd(lu); + lu->Close(); } /* -- cgit v1.2.3