Skip to content

Commit 04e69ec

Browse files
author
iacore
committed
Make Endpoint::close not owning
1 parent ab3afef commit 04e69ec

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

iroh-net/src/endpoint.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -853,14 +853,12 @@ impl Endpoint {
853853
endpoint,
854854
cancel_token,
855855
..
856-
} = self;
856+
} = &self;
857857
cancel_token.cancel();
858858
tracing::debug!("Closing connections");
859859
endpoint.close(error_code, reason);
860860
endpoint.wait_idle().await;
861-
// In case this is the last clone of `Endpoint`, dropping the `quinn::Endpoint` will
862-
// make it more likely that the underlying socket is not polled by quinn anymore after this
863-
drop(endpoint);
861+
864862
tracing::debug!("Connections closed");
865863

866864
msock.close().await?;

0 commit comments

Comments
 (0)