diff options
author | Alex Auvolat <alex@adnab.me> | 2022-08-31 15:58:05 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-08-31 15:58:05 +0200 |
commit | 01db3c43193d9a24ef4cd1a1b1993f4d44a9aa9b (patch) | |
tree | 5223fd62944353472769b37949ffc96f1060b839 /src/client.rs | |
parent | 700f783956697ef9d5aff4d904167f50367409e9 (diff) | |
download | netapp-01db3c43193d9a24ef4cd1a1b1993f4d44a9aa9b.tar.gz netapp-01db3c43193d9a24ef4cd1a1b1993f4d44a9aa9b.zip |
add debug_name in proto to differenciate messages
Diffstat (limited to 'src/client.rs')
-rw-r--r-- | src/client.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client.rs b/src/client.rs index 8227e8f..5c5a05b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -102,13 +102,16 @@ impl ClientConn { netapp.connected_as_client(peer_id, conn.clone()); + let debug_name = format!("CLI {}", hex::encode(&peer_id[..8])); + tokio::spawn(async move { - let send_future = tokio::spawn(conn.clone().send_loop(query_recv, write)); + let debug_name_2 = debug_name.clone(); + let send_future = tokio::spawn(conn.clone().send_loop(query_recv, write, debug_name_2)); 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) => r, _ = await_exit(stop_recv_loop_recv) => Ok(()) } }); |