]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
More stuff changed to const ref
[user/henk/code/inspircd.git] / src / users.cpp
index 263c68a942e9101ccb2a635e60fce880e56b2d68..550f7cf290b5a20ba9195ef2d8ee41be840cbad6 100644 (file)
@@ -938,14 +938,20 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached,
        New->sendqmax = class_sqmax;
        New->recvqmax = class_rqmax;
 
+       Instance->Log(DEBUG,"Push back to local users.");
        Instance->local_users.push_back(New);
 
+       Instance->Log(DEBUG,"Check softlimit: %d %d %d",Instance->local_users.size(), Instance->Config->SoftLimit, MAXCLIENTS);
        if ((Instance->local_users.size() > Instance->Config->SoftLimit) || (Instance->local_users.size() >= MAXCLIENTS))
        {
+               Instance->Log(DEBUG,"Check softlimit failed");
+               Instance->WriteOpers("*** Warning: softlimit value has been reached: %d clients", Instance->Config->SoftLimit);
                userrec::QuitUser(Instance, New,"No more connections allowed");
                return;
        }
 
+       Instance->Log(DEBUG,"Softlimit passed.");
+
        /*
         * XXX -
         * this is done as a safety check to keep the file descriptors within range of fd_ref_table.
@@ -962,6 +968,8 @@ void userrec::AddClient(InspIRCd* Instance, int socket, int port, bool iscached,
                return;
        }
 
+       Instance->Log(DEBUG,"socket < MAX_DESCRIPTORS passed.");
+
        ELine* e = Instance->XLines->matches_exception(New);
        if (!e)
        {
@@ -1126,8 +1134,11 @@ void userrec::FullConnect(CullList* Goners)
         * changes dont go out onto the network and produce 'fake direction'.
         */
        FOREACH_MOD(I_OnUserConnect,OnUserConnect(this));
-       FOREACH_MOD(I_OnPostConnect,OnPostConnect(this));
+
        this->registered = REG_ALL;
+
+       FOREACH_MOD(I_OnPostConnect,OnPostConnect(this));
+
        ServerInstance->SNO->WriteToSnoMask('c',"Client connecting on port %d: %s!%s@%s [%s]", this->GetPort(), this->nick, this->ident, this->host, this->GetIPString());
 }