Enforce the average allowed send rate is at least the one allowed by rfc1459.

This commit is contained in:
Jilles Tjoelker 2011-10-04 00:13:53 +02:00
parent 6a85e665db
commit 41ca4cac35

View file

@ -863,6 +863,14 @@ validate_conf(void)
}
/* RFC 1459 says 1 message per 2 seconds on average is acceptable,
* so allow at least that.
*/
if(ConfigFileEntry.client_flood_message_time >
ConfigFileEntry.client_flood_message_num * 2)
ConfigFileEntry.client_flood_message_time =
ConfigFileEntry.client_flood_message_num * 2;
if((ConfigFileEntry.client_flood_max_lines < CLIENT_FLOOD_MIN) ||
(ConfigFileEntry.client_flood_max_lines > CLIENT_FLOOD_MAX))
ConfigFileEntry.client_flood_max_lines = CLIENT_FLOOD_MAX;