mirror of
https://github.com/ratspeak/ratdeck.git
synced 2026-05-15 11:55:13 +00:00
Fix announce flood from TCP hub overwhelming device (v1.5.7)
4-layer defense against 100+ node announce storms from rns.ratspeak.org: - Transport-level rate limiter (5/sec) via filter_packet callback, before Ed25519 verify - TCP frame processing time-boxed to 15ms per loop iteration - Global announce rate limit (3/sec) in AnnounceManager - UI rebuild throttled to once per 2 seconds Also fixes message status not persisting to disk on queue drain.
This commit is contained in:
@@ -71,8 +71,9 @@ void TCPClientInterface::loop() {
|
||||
return; // Will reconnect on next loop iteration
|
||||
}
|
||||
|
||||
// Drain multiple incoming frames per loop (up to 10)
|
||||
for (int i = 0; i < 10 && _client.available(); i++) {
|
||||
// Drain multiple incoming frames per loop (up to 10, time-boxed)
|
||||
unsigned long tcpStart = millis();
|
||||
for (int i = 0; i < 10 && _client.available() && (millis() - tcpStart < TCP_LOOP_BUDGET_MS); i++) {
|
||||
unsigned long rxStart = millis();
|
||||
int len = readFrame();
|
||||
if (len > 0) {
|
||||
|
||||
Reference in New Issue
Block a user