aboutsummaryrefslogtreecommitdiff
path: root/src/server.rs
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2022-09-02 14:22:57 +0200
committerAlex <alex@adnab.me>2022-09-02 14:22:57 +0200
commita82700c5a27612002e6ee029ae77915b8114182f (patch)
tree7c79d9d17e1506f1fcddc6163fb27b2570f71113 /src/server.rs
parent8c73b276557405e5d7eac8139b6f8a79d0379200 (diff)
parentca25331d7320dddbe8f76c2a74bf406cd0622c2e (diff)
downloadnetapp-a82700c5a27612002e6ee029ae77915b8114182f.tar.gz
netapp-a82700c5a27612002e6ee029ae77915b8114182f.zip
Merge pull request 'Fix ping timeout and interval' (#4) from fix-ping into main
Reviewed-on: https://git.deuxfleurs.fr/lx/netapp/pulls/4
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..a835959 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!("SRV {}", 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);