]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Inspire -> InspIRCd
[user/henk/code/inspircd.git] / src / users.cpp
index 8089f5c235fc0e4bc9959dc114dcca8189319d01..8c3ad496969496421a7e34e4c20813b3e01da714 100644 (file)
@@ -64,7 +64,7 @@ template<typename T> inline string ConvToStr(const T &in)
 userrec::userrec()
 {
        // the PROPER way to do it, AVOID bzero at *ALL* costs
-       *nick = *ident = *host = *dhost = *fullname = *modes = *awaymsg = *oper = 0;
+       *password = *nick = *ident = *host = *dhost = *fullname = *modes = *awaymsg = *oper = 0;
        server = (char*)FindServerNamePtr(Config->ServerName);
        reset_due = TIME;
        lines_in = fd = lastping = signon = idle_lastmsg = nping = registered = 0;
@@ -276,7 +276,8 @@ bool userrec::AddBuffer(std::string a)
 
 bool userrec::BufferIsReady()
 {
-        for (unsigned int i = 0; i < recvq.length(); i++)
+       unsigned int t = recvq.length();
+        for (unsigned int i = 0; i < t; i++)
                if (recvq[i] == '\n')
                        return true;
         return false;
@@ -293,7 +294,7 @@ std::string userrec::GetBuffer()
                return "";
         char* line = (char*)recvq.c_str();
         std::string ret = "";
-        while ((*line != '\n') && (strlen(line)))
+        while ((*line != '\n') && (*line))
         {
                 ret = ret + *line;
                 line++;
@@ -728,11 +729,13 @@ void FullConnectUser(userrec* user, CullList* Goners)
        if (FindMatchingLocal(user) > a.maxlocal)
        {
                Goners->AddItem(user,"No more connections allowed from your host via this connect class (local)");
+               WriteOpers("*** WARNING: maximum LOCAL connections (%ld) exceeded for IP %s",a.maxlocal,(char*)inet_ntoa(user->ip4));
                return;
        }
-       if (FindMatchingGlobal(user) > a.maxglobal)
+       else if (FindMatchingGlobal(user) > a.maxglobal)
        {
                Goners->AddItem(user,"No more connections allowed from your host via this connect class (global)");
+               WriteOpers("*** WARNING: maximum GLOBAL connections (%ld) exceeded for IP %s",a.maxglobal,(char*)inet_ntoa(user->ip4));
                return;
        }