]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/usermanager.cpp
Remove dead code from UserManager::AddUser()
[user/henk/code/inspircd.git] / src / usermanager.cpp
index 4ebc3b5834be57142002bb52b983e6a579279b81..7e92507ca77b5844f3db08f8b5cb1ffa1e5eb9d2 100644 (file)
@@ -67,17 +67,7 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs
        /* NOTE: Calling this one parameter constructor for User automatically
         * allocates a new UUID and places it in the hash_map.
         */
-       LocalUser* New = NULL;
-       try
-       {
-               New = new LocalUser(socket, client, server);
-       }
-       catch (...)
-       {
-               ServerInstance->Logs->Log("USERS", LOG_DEFAULT, "*** WTF *** Duplicated UUID! -- Crack smoking monkeys have been unleashed.");
-               ServerInstance->SNO->WriteToSnoMask('a', "WARNING *** Duplicate UUID allocated!");
-               return;
-       }
+       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
@@ -320,9 +310,11 @@ void UserManager::DoBackgroundUserStuff()
        /*
         * loop over all local users..
         */
-       for (LocalList::iterator i = local_users.begin(); i != local_users.end(); ++i)
+       for (LocalList::iterator i = local_users.begin(); i != local_users.end(); )
        {
+               // It's possible that we quit the user below due to ping timeout etc. and QuitUser() removes it from the list
                LocalUser* curr = *i;
+               ++i;
 
                if (curr->CommandFloodPenalty || curr->eh.getSendQSize())
                {