1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-02 18:53:13 +02:00

Fix throttling only cleaning up old entries every 2 minutes.

That is, until the first REHASH happened, after that all is good.

This was caused by update_throttling_timer_settings() being
called before init_throttling().
This commit is contained in:
Bram Matthys
2021-12-06 17:38:52 +01:00
parent 177f7ef8c0
commit 07c2345af5
3 changed files with 1 additions and 9 deletions
+1
View File
@@ -224,4 +224,5 @@ void SetupEvents(void)
EventAdd(NULL, "handshake_timeout", handshake_timeout, NULL, 1000, 0);
EventAdd(NULL, "tls_check_expiry", tls_check_expiry, NULL, (86400/2)*1000, 0);
EventAdd(NULL, "unrealdb_expire_secret_cache", unrealdb_expire_secret_cache, NULL, 61000, 0);
EventAdd(NULL, "throttling_check_expire", throttling_check_expire, NULL, 1000, 0);
}
-8
View File
@@ -617,14 +617,6 @@ void update_throttling_timer_settings(void)
EventMod(EventFind("throttling_check_expire"), &eInfo);
}
void init_throttling()
{
EventAdd(NULL, "throttling_check_expire", throttling_check_expire, NULL, 123456, 0);
/* Note: the every_ms value (123,456) will be adjusted on boot and rehash
* via the update_throttling_timer_settings() function.
*/
}
uint64_t hash_throttling(const char *ip)
{
return siphash(ip, siphashkey_throttling) % THROTTLING_HASH_TABLE_SIZE;
-1
View File
@@ -1152,7 +1152,6 @@ int InitUnrealIRCd(int argc, char *argv[])
fix_timers();
write_pidfile();
init_throttling();
loop.booted = 1;
#if defined(HAVE_SETPROCTITLE)
setproctitle("%s", me.name);