summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-29 08:28:33 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-29 08:28:33 +0000
commit483ec8439c6564f8e3783223a01c641326b6f2d8 (patch)
tree15060c4e0ab845d5e2200c6841defb6ffebfea5d /src/inspircd.cpp
parentb14bd7e6682f2d3db52a512f6dddded39d328c63 (diff)
A few anti-flood features
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1260 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index c42306a30..2558f3efc 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -4101,6 +4101,18 @@ int InspIRCd(void)
while (current->BufferIsReady())
{
floodlines++;
+ if (TIME > current->reset_due)
+ {
+ current->reset_due = TIME+3;
+ current->lines_in = 0;
+ }
+ current->lines_in++;
+ if (current->lines_in > current->flood)
+ {
+ log(DEFAULT,"Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
+ WriteOpers("*** Excess flood from: %s!%s@%s",current->nick,current->ident,current->host);
+ kill_link(current,"Excess flood");
+ }
if ((floodlines > current->flood) && (current->flood != 0))
{
if (current->registered == 7)