Skip to content

Commit e0f54d3

Browse files
committed
feat: [torrust#1096] reset banning IP list every 2 minutes
Since the new solution with a HashMap consumes more memory, we should keep hte banning list short. The drawback is clients will be allowed to send more wrong connections IDs. However, sending 10 requests with wrong connection IDs every 2 minutos should not affect much the performance, unless we have many IPs, and in that case we would have a problem with memory anyway. In the future Sys Admin could inject this via a setting value.
1 parent 9eb9848 commit e0f54d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/servers/udp/server/launcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use crate::servers::udp::UDP_TRACKER_LOG_TARGET;
2525
/// The maximum number of connection id errors per ip. Clients will be banned if
2626
/// they exceed this limit.
2727
const MAX_CONNECTION_ID_ERRORS_PER_IP: u32 = 10;
28-
const IP_BANS_RESET_INTERVAL_IN_SECS: u64 = 3600;
28+
const IP_BANS_RESET_INTERVAL_IN_SECS: u64 = 120;
2929

3030
/// A UDP server instance launcher.
3131
#[derive(Constructor)]

0 commit comments

Comments
 (0)