From 4f554bf60bcda227bd8d5cceb6f4ba38a911e467 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Thu, 9 May 2024 14:55:19 +0200 Subject: [PATCH] add warning for truncated packages --- src/upd_loop.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/upd_loop.rs b/src/upd_loop.rs index adc579a..e5f7ed0 100644 --- a/src/upd_loop.rs +++ b/src/upd_loop.rs @@ -30,6 +30,10 @@ pub fn start_udp_thread(bind: String, stop_receiver: Receiver<()>) -> JoinHandle other => other.unwrap(), }; + if amount == buf.len(){ + warn!("the received package may have been truncated to a length of {}", amount); + } + handle_package(&mut buf[..amount]); } });