diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-11-06 22:37:36 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-11-06 22:37:36 +0000 |
commit | a26502ff51141c3cd74c078876d3322b49a3833c (patch) | |
tree | 3f1264fc7ff0be5f1f1f8eb6f82861b73081cc0c /src/usermanager.cpp | |
parent | 1b823b21c71a9047a9bbb5fa931085bb4929f26a (diff) |
Move StreamSocket inheritance off of User
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12047 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/usermanager.cpp')
-rw-r--r-- | src/usermanager.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 6315f059d..1e3e9fa72 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -32,15 +32,16 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs ServerInstance->SNO->WriteToSnoMask('a', "WARNING *** Duplicate UUID allocated!"); return; } + UserIOHandler* eh = &New->eh; /* Give each of the modules an attempt to hook the user for I/O */ - FOREACH_MOD(I_OnHookIO, OnHookIO(New, via)); + FOREACH_MOD(I_OnHookIO, OnHookIO(eh, via)); - if (New->GetIOHook()) + if (eh->GetIOHook()) { try { - New->GetIOHook()->OnStreamSocketAccept(New, client, server); + eh->GetIOHook()->OnStreamSocketAccept(eh, client, server); } catch (CoreException& modexcept) { @@ -127,7 +128,7 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs } } - if (!ServerInstance->SE->AddFd(New, FD_WANT_FAST_READ | FD_WANT_EDGE_WRITE)) + if (!ServerInstance->SE->AddFd(eh, FD_WANT_FAST_READ | FD_WANT_EDGE_WRITE)) { ServerInstance->Logs->Log("USERS", DEBUG,"Internal error on new connection"); this->QuitUser(New, "Internal error handling connection"); @@ -192,12 +193,13 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char { LocalUser* lu = IS_LOCAL(user); FOREACH_MOD(I_OnUserDisconnect,OnUserDisconnect(lu)); - lu->DoWrite(); - if (lu->GetIOHook()) + UserIOHandler* eh = &lu->eh; + eh->DoWrite(); + if (eh->GetIOHook()) { try { - lu->GetIOHook()->OnStreamSocketClose(lu); + eh->GetIOHook()->OnStreamSocketClose(eh); } catch (CoreException& modexcept) { @@ -205,8 +207,8 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char } } - ServerInstance->SE->DelFd(lu); - lu->Close(); + ServerInstance->SE->DelFd(eh); + eh->Close(); } /* |