]> arthur.barton.de Git - ngircd-alex.git/commit
enforce upper limit on maximum number of handled commands
authorFlorian Westphal <fw@strlen.de>
Mon, 25 May 2009 20:25:18 +0000 (22:25 +0200)
committerFlorian Westphal <fw@strlen.de>
Mon, 25 May 2009 20:25:18 +0000 (22:25 +0200)
commit643ae1b48bc83edad5ba5fa337f81564c79fd0cd
treee645bf2b5137af13dd7ec04ef440149a9218b1e9
parent9b1c47220fafeacda1e83b4732e1c8574062aac6
enforce upper limit on maximum number of handled commands

reported on #ngircd: pasting lots of lines into a channel can kill off
many people on the channel if the read buffer is drained quickly enough
and the client-side TCP can't keep up with the incoming data.

This implements a throttling scheme:
- an irc client may send up to 3 commands per second before a one second
pause is enforced.
- an irc client may send up to 256 bytes per second before a one second
pause is enforced.

After discussion with Alexander Barton, server <-> server links are
treated specially: There is no artificial limit on the number of bytes
sent per second, and up to 10 commands are processed per second before
a pause is enforced.

It may be neccessary to make those limits tuneable to accomondate larger
networks, but for now they are compile time values.
src/ngircd/conn.c
src/ngircd/conn.h