From: Attila Molnar Date: Wed, 24 Aug 2016 10:14:38 +0000 (+0200) Subject: Add socket into the SocketEngine as soon as possible in UserManager::AddUser() X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=0ca92e252e5a22f3378f1a6d621fee878fcbf09d;p=user%2Fhenk%2Fcode%2Finspircd.git Add socket into the SocketEngine as soon as possible in UserManager::AddUser() --- diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 5891b42f0..71ccd09da 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -88,6 +88,13 @@ 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->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.");