aboutsummaryrefslogtreecommitdiff
path: root/src/conn.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-02-17 17:43:07 +0100
committerAlex Auvolat <alex@adnab.me>2021-02-17 17:43:07 +0100
commit6ccf3a84957c276320d229418f78ac23d58680c1 (patch)
treeb737ac65123c7ce377ad0bad81d3dfcfcd69e0a4 /src/conn.rs
parent9e38b82edcba5f60eb0ed95b5551947c0c03ba3c (diff)
downloadnetapp-6ccf3a84957c276320d229418f78ac23d58680c1.tar.gz
netapp-6ccf3a84957c276320d229418f78ac23d58680c1.zip
Add resilience when peer_addr() fails
Diffstat (limited to 'src/conn.rs')
-rw-r--r--src/conn.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/conn.rs b/src/conn.rs
index a4c4f4e..daa0235 100644
--- a/src/conn.rs
+++ b/src/conn.rs
@@ -46,7 +46,7 @@ impl ServerConn {
let peer_id = handshake.peer_pk.clone();
let tokio_socket = asyncstd_socket.into_inner();
- let remote_addr = tokio_socket.peer_addr().unwrap();
+ let remote_addr = tokio_socket.peer_addr()?;
debug!(
"Handshake complete (server) with {}@{}",
@@ -160,7 +160,7 @@ impl ClientConn {
.await?;
let tokio_socket = asyncstd_socket.into_inner();
- let remote_addr = tokio_socket.peer_addr().unwrap();
+ let remote_addr = tokio_socket.peer_addr()?;
debug!(
"Handshake complete (client) with {}@{}",