rwhod: put max cap on status update storage

Without a max cap, someone could potentially flood our memory by posting
tons and tons of spoofed status updates.
This commit is contained in:
2026-07-20 23:41:05 +09:00
parent 2b89f6c755
commit 4373eec6b5
6 changed files with 196 additions and 7 deletions
+4 -4
View File
@@ -1,14 +1,14 @@
mod packet_receiver;
mod packet_sender;
mod rwhod_status;
mod status_registry;
pub use packet_receiver::rwhod_packet_receiver_task;
pub use packet_sender::{determine_relevant_interfaces, rwhod_packet_sender_task};
pub use rwhod_status::{generate_rwhod_status_update, generate_rwhod_user_entries};
pub use status_registry::RwhodStatusRegistry;
use std::{collections::HashMap, sync::Arc};
use std::sync::Arc;
use tokio::sync::RwLock;
use crate::proto::WhodStatusUpdate;
pub type RwhodStatusStore = Arc<RwLock<HashMap<String, WhodStatusUpdate>>>;
pub type RwhodStatusStore = Arc<RwLock<RwhodStatusRegistry>>;