summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-19 21:10:10 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-19 21:10:10 +0000
commit3bd628e8a1b211e610c21571e81489d07f4b217b (patch)
tree5c031ff0073bfadccf66aedd1ea601c7fc940e91 /src
parent307c04d888109f9297aaadb63f687f175795973c (diff)
Check GetPenaltyThreshold when processing commands
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11927 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/users.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/users.cpp b/src/users.cpp
index 1675b621b..616592495 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -515,8 +515,11 @@ void User::OnDataReady()
unsigned long sendqmax = ULONG_MAX;
if (MyClass && !HasPrivPermission("users/flood/increased-buffers"))
sendqmax = MyClass->GetSendqSoftMax();
+ int penaltymax = MyClass->GetPenaltyThreshold();
+ if (penaltymax == 0 || HasPrivPermission("users/flood/no-fakelag"))
+ penaltymax = INT_MAX;
- while (Penalty < 10 && getSendQSize() < sendqmax)
+ while (Penalty < penaltymax && getSendQSize() < sendqmax)
{
std::string line;
line.reserve(MAXBUF);
@@ -549,6 +552,8 @@ eol_found:
this->cmds_in++;
ServerInstance->Parser->ProcessBuffer(line, this);
+ if (quitting)
+ return;
}
// Add pseudo-penalty so that we continue processing after sendq recedes
if (Penalty == 0 && getSendQSize() >= sendqmax)