]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add socket into the SocketEngine as soon as possible in UserManager::AddUser()
authorAttila Molnar <attilamolnar@hush.com>
Wed, 24 Aug 2016 10:14:38 +0000 (12:14 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Wed, 24 Aug 2016 10:14:38 +0000 (12:14 +0200)
src/usermanager.cpp

index 5891b42f014f61cf3db0b70b8ab5889bb59e63d5..71ccd09da6679322e185e64c2b00a71d3e851000 100644 (file)
@@ -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.");