X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusermanager.cpp;h=15c86157bff3784053fcbb596b9d3adefb909819;hb=fb7acf3bf7db27f61d9261a99862654dd3721a06;hp=5891b42f014f61cf3db0b70b8ab5889bb59e63d5;hpb=b9e11915a976daaf790ebc763aff56e19fd49e0f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 5891b42f0..15c86157b 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -71,14 +71,6 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs LocalUser* const New = new LocalUser(socket, client, server); UserIOHandler* eh = &New->eh; - // If this listener has an IO hook provider set then tell it about the connection - for (ListenSocket::IOHookProvList::iterator i = via->iohookprovs.begin(); i != via->iohookprovs.end(); ++i) - { - ListenSocket::IOHookProvRef& iohookprovref = *i; - if (iohookprovref) - iohookprovref->OnAccept(eh, client, server); - } - ServerInstance->Logs->Log("USERS", LOG_DEBUG, "New user fd: %d", socket); this->unregistered_count++; @@ -88,6 +80,21 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs this->local_users.push_front(New); + if (!SocketEngine::AddFd(eh, FD_WANT_FAST_READ | FD_WANT_EDGE_WRITE)) + { + ServerInstance->Logs->Log("USERS", LOG_DEBUG, "Internal error on new connection"); + this->QuitUser(New, "Internal error handling connection"); + return; + } + + // If this listener has an IO hook provider set then tell it about the connection + for (ListenSocket::IOHookProvList::iterator i = via->iohookprovs.begin(); i != via->iohookprovs.end(); ++i) + { + ListenSocket::IOHookProvRef& iohookprovref = *i; + if (iohookprovref) + iohookprovref->OnAccept(eh, client, server); + } + if (this->local_users.size() > ServerInstance->Config->SoftLimit) { ServerInstance->SNO->WriteToSnoMask('a', "Warning: softlimit value has been reached: %d clients", ServerInstance->Config->SoftLimit); @@ -147,13 +154,6 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs } } - if (!SocketEngine::AddFd(eh, FD_WANT_FAST_READ | FD_WANT_EDGE_WRITE)) - { - ServerInstance->Logs->Log("USERS", LOG_DEBUG, "Internal error on new connection"); - this->QuitUser(New, "Internal error handling connection"); - return; - } - if (ServerInstance->Config->RawLog) New->WriteNotice("*** Raw I/O logging is enabled on this server. All messages, passwords, and commands are being recorded.");