From 4afab41abe29fb973879730c922404e91d7cab63 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Wed, 4 Oct 2023 15:50:03 +0200 Subject: [PATCH] changed debug messages --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8bbffd8..9753e4c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -122,7 +122,7 @@ fn broadcast( fn remove_old_clients(socket: &UdpSocket, subscribers: &mut HashMap>) { let timestamp = Local::now(); - debug!("Number of clients: {}", subscribers.len()); + //debug!("Number of clients: {}", subscribers.len()); for cl in &*subscribers { if *cl.1 + Duration::seconds(CLIENT_TIMEOUT as i64) < timestamp { @@ -157,8 +157,9 @@ fn main() -> std::io::Result<()> { Ok((num, s)) => (num, s), Err(_) => { remove_old_clients(&socket, &mut subscribers); - debug!("Sending keepalive pakets …"); + // debug!("Sending keepalive pakets …"); for rec in &subscribers { + debug!("Sending keepalive paket to {}", rec.0); socket.send_to(b"", rec.0).unwrap(); } continue; @@ -173,6 +174,7 @@ fn main() -> std::io::Result<()> { if subscribers.contains_key(&client_addr) { debug!("Client known: {client_addr}"); + if strip_header(data) == strip_header(mopp(speed, b":bye").as_slice()) { debug!("Removing client {client_addr} as requested."); socket