From 7f04dcfc4c04f2266f1399f238f8869c1c09b57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Sat, 28 Nov 2020 02:44:43 +0100 Subject: print weird ping response --- mumd/src/main.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'mumd/src') diff --git a/mumd/src/main.rs b/mumd/src/main.rs index c0caa77..db6d2ef 100644 --- a/mumd/src/main.rs +++ b/mumd/src/main.rs @@ -31,11 +31,15 @@ async fn main() { if let Ok(server_name) = fs::read_to_string(mumlib::SOCKET_PATH) { if let Ok(tx0) = IpcSender::connect(server_name) { if tx0.send((Command::Ping, tx_client)).is_ok() { - if matches!(rx_client.recv().unwrap(), Ok(Some(CommandResponse::Pong))) { - error!("Another instance of mumd is already running"); - return; - } else { - warn!("Ping with no response. Continuing..."); + match rx_client.recv() { + Ok(Ok(Some(CommandResponse::Pong))) => { + error!("Another instance of mumd is already running"); + return; + }, + resp => { + warn!("Ping with weird response. Continuing..."); + debug!("Response was {:?}", resp); + } } } } -- cgit v1.2.1