diff options
author | frostycoolslug <frostycoolslug@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-01-22 11:24:08 +0000 |
---|---|---|
committer | frostycoolslug <frostycoolslug@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-01-22 11:24:08 +0000 |
commit | 65d3f80df5b672bffb00355892bf6454b488caf9 (patch) | |
tree | a1c70f565bf625b7ba6f9422c4d20e3a1db2e785 /src/userprocess.cpp | |
parent | f2ee212c2ba2558a65078b6cd65adb463d047920 (diff) |
Stopped lines longer than 512b from being killed, instead, warning sent and dropped.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2824 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/userprocess.cpp')
-rw-r--r-- | src/userprocess.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/userprocess.cpp b/src/userprocess.cpp index 3e1cedb11..41a860d9b 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -127,8 +127,24 @@ void ProcessUser(userrec* cu) { // AddBuffer returned false, theres too much data in the user's buffer and theyre up to no good. if (current->registered == 7) - { - kill_link(current,"RecvQ exceeded"); + { + // Make sure they arn't flooding long lines. + if (TIME > current->reset_due) + { + current->reset_due = TIME + current->threshold; + 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"); + return; + } else { + WriteServ(currfd, "NOTICE %s :Your previous line was too long and was not delivered (Over 512chars) Please shorten it.", current->nick); + current->recvq = ""; + } } else { |