From 2b809ec9b39b88c1316152da3fbc9bee0956a442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Fri, 11 Jun 2021 04:13:45 +0200 Subject: print server state on connect --- mumd/src/state.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mumd/src/state.rs') diff --git a/mumd/src/state.rs b/mumd/src/state.rs index 2cfdfb1..37dd6a2 100644 --- a/mumd/src/state.rs +++ b/mumd/src/state.rs @@ -605,7 +605,8 @@ pub fn handle_command( accept_invalid_cert, ))) .unwrap(); - at!(TcpEvent::Connected, |res| { + let state = Arc::clone(&og_state); + at!(TcpEvent::Connected, move |res| { //runs the closure when the client is connected if let TcpEventData::Connected(res) = res { Box::new(iter::once(res.map(|msg| { @@ -615,6 +616,7 @@ pub fn handle_command( } else { None }, + server_state: state.read().unwrap().server.as_ref().unwrap().into(), }) }))) } else { -- cgit v1.2.1