aboutsummaryrefslogtreecommitdiffstats
path: root/mumd/src/network
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-04-11 22:52:41 +0200
committerGustav Sörnäs <gustav@sornas.net>2021-04-11 22:52:41 +0200
commit30264e1fa0e2602d29141409ecc8326bce1917aa (patch)
treefb7bfc49e5ab641b53f4704a8261f757a50c5504 /mumd/src/network
parentc8e92b3fe0ec73cd0d87e778ee85eac9a0d6c4e4 (diff)
downloadmum-30264e1fa0e2602d29141409ecc8326bce1917aa.tar.gz
correct output
Diffstat (limited to 'mumd/src/network')
-rw-r--r--mumd/src/network/udp.rs9
1 files changed, 4 insertions, 5 deletions
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());
}
}
}