aboutsummaryrefslogtreecommitdiff
path: root/src/server.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-08-31 15:58:05 +0200
committerAlex Auvolat <alex@adnab.me>2022-08-31 15:58:05 +0200
commit01db3c43193d9a24ef4cd1a1b1993f4d44a9aa9b (patch)
tree5223fd62944353472769b37949ffc96f1060b839 /src/server.rs
parent700f783956697ef9d5aff4d904167f50367409e9 (diff)
downloadnetapp-01db3c43193d9a24ef4cd1a1b1993f4d44a9aa9b.tar.gz
netapp-01db3c43193d9a24ef4cd1a1b1993f4d44a9aa9b.zip
add debug_name in proto to differenciate messages
Diffstat (limited to 'src/server.rs')
-rw-r--r--src/server.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/server.rs b/src/server.rs
index 5465307..9bcf2a6 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -105,14 +105,17 @@ impl ServerConn {
netapp.connected_as_server(peer_id, conn.clone());
+ let debug_name = format!("SVR {}", hex::encode(&peer_id[..8]));
+ let debug_name_2 = debug_name.clone();
+
let conn2 = conn.clone();
let recv_future = tokio::spawn(async move {
select! {
- r = conn2.recv_loop(read) => r,
+ r = conn2.recv_loop(read, debug_name_2) => r,
_ = await_exit(must_exit) => Ok(())
}
});
- let send_future = tokio::spawn(conn.clone().send_loop(resp_recv, write));
+ let send_future = tokio::spawn(conn.clone().send_loop(resp_recv, write, debug_name));
recv_future.await.log_err("ServerConn recv_loop");
conn.resp_send.store(None);