From 7e848151aea0ad579acbd51125907d96cc67438b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Sat, 10 Apr 2021 19:28:37 +0200 Subject: timeout server pings --- mumd/src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mumd/src/main.rs') diff --git a/mumd/src/main.rs b/mumd/src/main.rs index d7bc2c0..341300e 100644 --- a/mumd/src/main.rs +++ b/mumd/src/main.rs @@ -109,7 +109,10 @@ async fn receive_commands( sender.send((command, tx)).unwrap(); - let response = rx.await.unwrap(); + let response = match rx.await { + Ok(r) => r, + Err(_) => Ok(None), + }; let mut serialized = BytesMut::new(); bincode::serialize_into((&mut serialized).writer(), &response).unwrap(); -- cgit v1.2.1