diff options
-rw-r--r-- | include/users.h | 24 | ||||
-rw-r--r-- | src/command_parse.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_operflood.cpp | 1 | ||||
-rw-r--r-- | src/modules/m_safelist.cpp | 2 | ||||
-rw-r--r-- | src/userprocess.cpp | 10 | ||||
-rw-r--r-- | src/users.cpp | 15 |
6 files changed, 15 insertions, 45 deletions
diff --git a/include/users.h b/include/users.h index 148c673f4..c35680dac 100644 --- a/include/users.h +++ b/include/users.h @@ -585,12 +585,6 @@ class CoreExport User : public connection */ char awaymsg[MAXAWAY+1]; - /** Number of lines the user can place into the buffer - * (up to the global NetBufferSize bytes) before they - * are disconnected for excess flood - */ - int flood; - /** Timestamp of current time + connection class timeout. * This user must send USER/NICK before this timestamp is * reached or they will be disconnected. @@ -610,10 +604,6 @@ class CoreExport User : public connection */ bool dns_done; - /** Number of seconds between PINGs for this user (set from <connect:allow> tag - */ - unsigned int pingmax; - /** Password specified by the user when they registered. * This is stored even if the <connect> block doesnt need a password, so that * modules may check it. @@ -639,10 +629,6 @@ class CoreExport User : public connection */ time_t reset_due; - /** Flood counters - Highest value lines_in may reach before the user gets disconnected - */ - long threshold; - /** If this is set to true, then all read operations for the user * are dropped into the bit-bucket. * This is used by the global CullList, but please note that setting this value @@ -682,16 +668,6 @@ class CoreExport User : public connection */ std::string WriteError; - /** Maximum size this user's sendq can become. - * Copied from the connect class on connect. - */ - long sendqmax; - - /** Maximum size this user's recvq can become. - * Copied from the connect class on connect. - */ - long recvqmax; - /** This is true if the user matched an exception when they connected to the ircd. * It isnt valid after this point, and you should not attempt to do anything with it * after this point, because the eline might be removed at a later time, and/or no diff --git a/src/command_parse.cpp b/src/command_parse.cpp index 6db10658b..0c3f29a25 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -225,17 +225,17 @@ void CommandParser::DoLines(User* current, bool one_only) { if (ServerInstance->Time() > current->reset_due) { - current->reset_due = ServerInstance->Time() + current->threshold; + current->reset_due = ServerInstance->Time() + current->MyClass->GetThreshold(); current->lines_in = 0; } - if (++current->lines_in > current->flood && current->flood) + if (++current->lines_in > current->MyClass->GetFlood() && current->MyClass->GetFlood()) { ServerInstance->FloodQuitUser(current); return; } - if ((++floodlines > current->flood) && (current->flood != 0)) + if ((++floodlines > current->MyClass->GetFlood()) && (current->MyClass->GetFlood() != 0)) { ServerInstance->FloodQuitUser(current); return; @@ -319,7 +319,7 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd) } /* activity resets the ping pending timer */ - user->nping = ServerInstance->Time() + user->pingmax; + user->nping = ServerInstance->Time() + user->MyClass->GetPingTime(); if (cm->second->flags_needed) { if (!user->IsModeSet(cm->second->flags_needed)) diff --git a/src/modules/m_operflood.cpp b/src/modules/m_operflood.cpp index 4532b7d3e..02a6b85f2 100644 --- a/src/modules/m_operflood.cpp +++ b/src/modules/m_operflood.cpp @@ -37,7 +37,6 @@ public: if(!IS_LOCAL(user))
return;
- user->flood = 0;
user->ExemptFromPenalty = true;
user->WriteServ("NOTICE %s :*** You are now free from flood limits.", user->nick);
}
diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp index a2135bd6b..0155492fc 100644 --- a/src/modules/m_safelist.cpp +++ b/src/modules/m_safelist.cpp @@ -217,7 +217,7 @@ class ModuleSafeList : public Module } ld->list_position++; } - while ((chan != NULL) && (amount_sent < (user->sendqmax / 4))); + while ((chan != NULL) && (amount_sent < (user->MyClass->GetSendqMax() / 4))); if (ld->list_ended) { user->Shrink("safelist_cache"); diff --git a/src/userprocess.cpp b/src/userprocess.cpp index 70f0e246f..a3c8bc305 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -104,13 +104,13 @@ void ProcessUserHandler::Call(User* cu) // Make sure they arn't flooding long lines. if (Server->Time() > current->reset_due) { - current->reset_due = Server->Time() + current->threshold; + current->reset_due = Server->Time() + current->MyClass->GetThreshold(); current->lines_in = 0; } current->lines_in++; - if (current->flood && current->lines_in > current->flood) + if (current->MyClass->GetFlood() && current->lines_in > current->MyClass->GetFlood()) Server->FloodQuitUser(current); else { @@ -210,18 +210,18 @@ void InspIRCd::DoBackgroundUserStuff() // This user didn't answer the last ping, remove them if (!curr->lastping) { - time_t time = this->Time(false) - (curr->nping - curr->pingmax); + time_t time = this->Time(false) - (curr->nping - curr->MyClass->GetPingTime()); char message[MAXBUF]; snprintf(message, MAXBUF, "Ping timeout: %ld second%s", (long)time, time > 1 ? "s" : ""); curr->muted = true; curr->lastping = 1; - curr->nping = TIME+curr->pingmax; + curr->nping = TIME + curr->MyClass->GetPingTime(); User::QuitUser(this, curr, message); continue; } curr->Write("PING :%s",this->Config->ServerName); curr->lastping = 0; - curr->nping = TIME+curr->pingmax; + curr->nping = TIME +curr->MyClass->GetPingTime(); } } } diff --git a/src/users.cpp b/src/users.cpp index a901552fd..c6ebcc848 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -179,7 +179,7 @@ User::User(InspIRCd* Instance, const std::string &uid) : ServerInstance(Instance age = ServerInstance->Time(true); Penalty = 0; lines_in = lastping = signon = idle_lastmsg = nping = registered = 0; - ChannelCount = timeout = flood = bytes_in = bytes_out = cmds_in = cmds_out = 0; + ChannelCount = timeout = bytes_in = bytes_out = cmds_in = cmds_out = 0; OverPenalty = ExemptFromPenalty = muted = exempt = haspassed = dns_done = false; fd = -1; recvq.clear(); @@ -495,10 +495,10 @@ bool User::AddBuffer(std::string a) if (a.length()) recvq.append(a); - if (recvq.length() > (unsigned)this->recvqmax) + if (recvq.length() > (unsigned)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->recvqmax); + ServerInstance->WriteOpers("*** User %s RecvQ of %d exceeds connect class maximum of %d",this->nick,recvq.length(),this->MyClass->GetRecvqMax()); return false; } @@ -567,7 +567,7 @@ void User::AddWriteBuf(const std::string &data) if (*this->GetWriteError()) return; - if (sendq.length() + data.length() > (unsigned)this->sendqmax) + if (sendq.length() + data.length() > (unsigned)this->MyClass->GetSendqMax()) { /* * Fix by brain - Set the error text BEFORE calling writeopers, because @@ -575,7 +575,7 @@ void User::AddWriteBuf(const std::string &data) * 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->sendqmax); + ServerInstance->WriteOpers("*** User %s SendQ of %d exceeds connect class maximum of %d",this->nick,sendq.length() + data.length(),this->MyClass->GetSendqMax()); return; } @@ -912,13 +912,8 @@ void User::CheckClass() return; } - this->pingmax = a->GetPingTime(); this->nping = ServerInstance->Time() + a->GetPingTime() + ServerInstance->Config->dns_timeout; this->timeout = ServerInstance->Time() + a->GetRegTimeout(); - this->flood = a->GetFlood(); - this->threshold = a->GetThreshold(); - this->sendqmax = a->GetSendqMax(); - this->recvqmax = a->GetRecvqMax(); this->MaxChans = a->GetMaxChans(); } |