diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2020-11-28 02:44:43 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2020-11-28 02:44:43 +0100 |
| commit | 7f04dcfc4c04f2266f1399f238f8869c1c09b57a (patch) | |
| tree | 3736f150813671ef0ac3aa8f2a847021ca7bb3a7 /mumd/src/main.rs | |
| parent | 8dc946ae953c7d0d3f9c6c90c0aa78d6f17e0cf9 (diff) | |
| download | mum-7f04dcfc4c04f2266f1399f238f8869c1c09b57a.tar.gz | |
print weird ping response
Diffstat (limited to 'mumd/src/main.rs')
| -rw-r--r-- | mumd/src/main.rs | 14 |
1 files changed, 9 insertions, 5 deletions
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); + } } } } |
