]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Tweaks
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 14 Oct 2007 00:06:56 +0000 (00:06 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 14 Oct 2007 00:06:56 +0000 (00:06 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8174 e03df62e-2008-0410-955e-edbf42e46eb7

src/users.cpp

index 79877d9c8e7526fd75c7c764c06ee720fdb8ab18..31244f98706b5bf28344a44c762a3f36c04a7ca2 100644 (file)
@@ -917,6 +917,18 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached,
                New->dhost[j] = New->host[j] = *temp;
        New->dhost[j] = New->host[j] = 0;
 
+        if (socket > -1)
+        {
+                if (!Instance->SE->AddFd(New))
+                {
+                        Instance->Log(DEBUG,"ERROR: Could not add new user %s!%s@%s to the socket engine!!!", New->nick, New->ident, New->host);
+                        close(socket);
+                        shutdown(socket,2);
+                        delete New;
+                        return;
+                }
+        }
+
        Instance->AddLocalClone(New);
        Instance->AddGlobalClone(New);
 
@@ -980,15 +992,6 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached,
                }
        }
 
-       if (socket > -1)
-       {
-               if (!Instance->SE->AddFd(New))
-               {
-                       userrec::QuitUser(Instance, New, "Internal error handling connection");
-                       return;
-               }
-       }
-
        /* NOTE: even if dns lookups are *off*, we still need to display this.
         * BOPM and other stuff requires it.
         */