diff --git a/.gitignore b/.gitignore index cab005a3..7030625e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ **/*.rs.bk Cargo.lock *.*~ +.idea diff --git a/src/connections.rs b/src/connections.rs index fd2b635b..70121a97 100644 --- a/src/connections.rs +++ b/src/connections.rs @@ -167,7 +167,10 @@ pub(super) fn listen_for_incoming_connections( ); } Err(err) => { - error!("An incoming connection failed because of an error: {}", err); + error!( + "An incoming connection failed because of an error: {:?}", + err + ); } }, None => { @@ -216,7 +219,7 @@ async fn read_on_uni_streams( } Err(err) => { warn!( - "Failed to read incoming message on uni-stream for peer {:?} with error: {}", + "Failed to read incoming message on uni-stream for peer {:?} with error: {:?}", peer_addr, err ); break; @@ -230,7 +233,7 @@ async fn read_on_uni_streams( Err(Error::StreamRead(quinn::ReadExactError::FinishedEarly)) => break, Err(err) => { error!( - "Failed reading from a uni-stream for peer {:?} with error: {}", + "Failed reading from a uni-stream for peer {:?} with error: {:?}", peer_addr, err ); break; @@ -256,7 +259,7 @@ async fn read_on_bi_streams( } Err(err) => { warn!( - "Failed to read incoming message on bi-stream for peer {:?} with error: {}", + "Failed to read incoming message on bi-stream for peer {:?} with error: {:?}", peer_addr, err ); break; @@ -269,7 +272,7 @@ async fn read_on_bi_streams( Ok(WireMsg::EndpointEchoReq) => { if let Err(error) = handle_endpoint_echo_req(peer_addr, &mut send).await { error!( - "Failed to handle Echo Request for peer {:?} with error: {}", + "Failed to handle Echo Request for peer {:?} with error: {:?}", peer_addr, error ); } @@ -283,7 +286,7 @@ async fn read_on_bi_streams( ) .await { - error!("Failed to handle Endpoint verification request for peer {:?} with error: {}", peer_addr, error); + error!("Failed to handle Endpoint verification request for peer {:?} with error: {:?}", peer_addr, error); } } Ok(msg) => { @@ -295,7 +298,7 @@ async fn read_on_bi_streams( Err(Error::StreamRead(quinn::ReadExactError::FinishedEarly)) => break, Err(err) => { error!( - "Failed reading from a bi-stream for peer {:?} with error: {}", + "Failed reading from a bi-stream for peer {:?} with error: {:?}", peer_addr, err ); break; @@ -388,6 +391,7 @@ mod tests { let connection = peer1 .get_connection(&peer2_addr) + .await .ok_or(Error::MissingConnection)?; let (mut send_stream, mut recv_stream) = connection.open_bi().await?; let message = WireMsg::EndpointEchoReq; diff --git a/src/tests/common.rs b/src/tests/common.rs index fad894fe..a1d0a7a5 100644 --- a/src/tests/common.rs +++ b/src/tests/common.rs @@ -191,7 +191,7 @@ async fn disconnection() -> Result<()> { } // After Alice disconnects from Bob both peers should receive the disconnected event. - alice.disconnect_from(&bob_addr)?; + alice.disconnect_from(&bob_addr).await?; if let Some(disconnected_peer) = alice_disconnections.next().await { assert_eq!(disconnected_peer, bob_addr); @@ -273,7 +273,7 @@ async fn simultaneous_incoming_and_outgoing_connections() -> Result<()> { } // Drop the connection initiated by Bob. - bob.disconnect_from(&alice_addr)?; + bob.disconnect_from(&alice_addr).await?; // It should be closed on Alice's side too. if let Some(disconnected_peer) = alice_disconnections.next().await {