]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/usermanager.cpp
Merge branch 'master+invite'
[user/henk/code/inspircd.git] / src / usermanager.cpp
index 4ebc3b5834be57142002bb52b983e6a579279b81..41061f6d1d82decc109b3eb1fb3b6d4b34378ce3 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
@@ -293,10 +283,7 @@ void UserManager::GarbageCollect()
        // Reset the already_sent IDs so we don't wrap it around and drop a message
        LocalUser::already_sent_id = 0;
        for (LocalList::const_iterator i = local_users.begin(); i != local_users.end(); ++i)
-       {
                (**i).already_sent = 0;
-               (**i).RemoveExpiredInvites();
-       }
 }
 
 /* this returns true when all modules are satisfied that the user should be allowed onto the irc server
@@ -320,9 +307,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())
                {