From 30264e1fa0e2602d29141409ecc8326bce1917aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Sun, 11 Apr 2021 22:52:41 +0200 Subject: correct output --- mumd/src/network/udp.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'mumd/src') diff --git a/mumd/src/network/udp.rs b/mumd/src/network/udp.rs index 808d853..d8cbc2a 100644 --- a/mumd/src/network/udp.rs +++ b/mumd/src/network/udp.rs @@ -230,14 +230,14 @@ pub async fn handle_pings( let sender = async { while let Some((id, socket_addr, handle)) = ping_request_receiver.recv().await { - debug!("Sending ping {} to {}", id, socket_addr); + debug!("Sending ping with id {} to {}", id, socket_addr); let packet = PingPacket { id }; let packet: [u8; 12] = packet.into(); udp_socket.send_to(&packet, &socket_addr).await.unwrap(); let (tx, rx) = oneshot::channel(); match pending.lock().await.entry(id) { Entry::Occupied(_) => { - warn!("Tried to send duplicate ping {}", id); + warn!("Tried to send duplicate ping with id {}", id); continue; } Entry::Vacant(v) => { @@ -272,7 +272,6 @@ pub async fn handle_pings( warn!("Ping response had length {}, expected 24", read); continue; } - assert_eq!(read, 24); // just checked let packet = PongPacket::try_from(buf.as_slice()).unwrap(); @@ -280,11 +279,11 @@ pub async fn handle_pings( Entry::Occupied(o) => { let id = *o.key(); if o.remove().send(packet).is_err() { - debug!("Received response to ping {} too late", id); + debug!("Received response to ping with id {} too late", id); } } Entry::Vacant(v) => { - warn!("Received ping {} that we didn't send", v.key()); + warn!("Received ping with id {} that we didn't send", v.key()); } } } -- cgit v1.2.1