]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Patch: /rehash (not /rehash ssl) will now rebind SSL ports, but not dh params etc...
[user/henk/code/inspircd.git] / src / users.cpp
index f2c2d9ae4cf315257978bf7fa30802898d54a90d..731f5a603a1c66e3f4cf1ce6b7b92014fca90abf 100644 (file)
@@ -181,7 +181,7 @@ User::User(InspIRCd* Instance, const std::string &uid) : ServerInstance(Instance
        Penalty = 0;
        lines_in = lastping = signon = idle_lastmsg = nping = registered = 0;
        ChannelCount = timeout = bytes_in = bytes_out = cmds_in = cmds_out = 0;
-       OverPenalty = ExemptFromPenalty = muted = exempt = haspassed = dns_done = false;
+       OverPenalty = ExemptFromPenalty = quitting = exempt = haspassed = dns_done = false;
        fd = -1;
        recvq.clear();
        sendq.clear();
@@ -452,7 +452,7 @@ bool User::AddBuffer(std::string a)
                if (this->MyClass && (recvq.length() > this->MyClass->GetRecvqMax()))
                {
                        this->SetWriteError("RecvQ exceeded");
-                       ServerInstance->WriteOpers("*** User %s RecvQ of %d exceeds connect class maximum of %d",this->nick,recvq.length(),this->MyClass->GetRecvqMax());
+                       ServerInstance->SNO->WriteToSnoMask('A', "User %s RecvQ of %d exceeds connect class maximum of %d",this->nick,recvq.length(),this->MyClass->GetRecvqMax());
                        return false;
                }
 
@@ -524,12 +524,12 @@ void User::AddWriteBuf(const std::string &data)
        if (this->MyClass && (sendq.length() + data.length() > this->MyClass->GetSendqMax()))
        {
                /*
-                * Fix by brain - Set the error text BEFORE calling writeopers, because
+                * Fix by brain - Set the error text BEFORE calling, because
                 * if we dont it'll recursively  call here over and over again trying
                 * to repeatedly add the text to the sendq!
                 */
                this->SetWriteError("SendQ exceeded");
-               ServerInstance->WriteOpers("*** User %s SendQ of %d exceeds connect class maximum of %d",this->nick,sendq.length() + data.length(),this->MyClass->GetSendqMax());
+               ServerInstance->SNO->WriteToSnoMask('A', "User %s SendQ of %d exceeds connect class maximum of %d",this->nick,sendq.length() + data.length(),this->MyClass->GetSendqMax());
                return;
        }
 
@@ -543,7 +543,7 @@ void User::AddWriteBuf(const std::string &data)
        catch (...)
        {
                this->SetWriteError("SendQ exceeded");
-               ServerInstance->WriteOpers("*** User %s SendQ got an exception",this->nick);
+               ServerInstance->SNO->WriteToSnoMask('A', "User %s SendQ got an exception",this->nick);
        }
 }
 
@@ -708,7 +708,6 @@ void User::QuitUser(InspIRCd* Instance, User *user, const std::string &quitreaso
 {
        Instance->Log(DEBUG,"QuitUser: %s '%s'", user->nick, quitreason.c_str());
        user->Write("ERROR :Closing link (%s@%s) [%s]", user->ident, user->host, *operreason ? operreason : quitreason.c_str());
-       user->muted = true;
        user->quietquit = false;
        user->quitmsg = quitreason;
        user->operquitmsg = operreason;
@@ -742,13 +741,13 @@ void User::CheckClass()
        else if ((a->GetMaxLocal()) && (ServerInstance->Users->LocalCloneCount(this) > a->GetMaxLocal()))
        {
                User::QuitUser(ServerInstance, this, "No more connections allowed from your host via this connect class (local)");
-               ServerInstance->WriteOpers("*** WARNING: maximum LOCAL connections (%ld) exceeded for IP %s", a->GetMaxLocal(), this->GetIPString());
+               ServerInstance->SNO->WriteToSnoMask('A', "WARNING: maximum LOCAL connections (%ld) exceeded for IP %s", a->GetMaxLocal(), this->GetIPString());
                return;
        }
        else if ((a->GetMaxGlobal()) && (ServerInstance->Users->GlobalCloneCount(this) > a->GetMaxGlobal()))
        {
                User::QuitUser(ServerInstance, this, "No more connections allowed from your host via this connect class (global)");
-               ServerInstance->WriteOpers("*** WARNING: maximum GLOBAL connections (%ld) exceeded for IP %s", a->GetMaxGlobal(), this->GetIPString());
+               ServerInstance->SNO->WriteToSnoMask('A', "WARNING: maximum GLOBAL connections (%ld) exceeded for IP %s", a->GetMaxGlobal(), this->GetIPString());
                return;
        }
 
@@ -785,7 +784,6 @@ void User::FullConnect()
 
                if (r)
                {
-                       this->muted = true;
                        r->Apply(this);
                        return;
                }
@@ -794,7 +792,6 @@ void User::FullConnect()
 
                if (n)
                {
-                       this->muted = true;
                        n->Apply(this);
                        return;
                }
@@ -1702,6 +1699,9 @@ void User::ShowRULES()
 
 void User::HandleEvent(EventType et, int errornum)
 {
+       if (this->quitting) // drop everything, user is due to be quit
+               return;
+
        /* WARNING: May delete this user! */
        int thisfd = this->GetFd();