File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed
iroh/src/magicsock/endpoint_map Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -726,16 +726,7 @@ impl EndpointStateActor {
726726 /// - A DISCO call-me-maybe message advertising our own addresses will be sent.
727727 #[ instrument( skip_all) ]
728728 async fn do_holepunching ( & mut self ) {
729- let Some ( relay_addr) = self
730- . paths
731- . addrs ( )
732- . filter_map ( |addr| match addr {
733- transports:: Addr :: Ip ( _) => None ,
734- transports:: Addr :: Relay ( _, _) => Some ( addr) ,
735- } )
736- . next ( )
737- . cloned ( )
738- else {
729+ let Some ( relay_addr) = self . paths . addrs ( ) . find ( |addr| addr. is_relay ( ) ) . cloned ( ) else {
739730 warn ! ( "holepunching requested but have no relay address" ) ;
740731 return ;
741732 } ;
@@ -1424,7 +1415,7 @@ impl Future for OnClosed {
14241415 }
14251416}
14261417
1427- /// Converts an interator of [`TransportAddr'] into an iterator of [`transports::Addr`].
1418+ /// Converts an iterator of [`TransportAddr'] into an iterator of [`transports::Addr`].
14281419fn to_transports_addr (
14291420 endpoint_id : EndpointId ,
14301421 addrs : impl IntoIterator < Item = TransportAddr > ,
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ impl EndpointPathState {
117117 self . paths . keys ( )
118118 }
119119
120- /// Replies to all pending requests from [`EndpointStateMessage::ResolveRemote`] .
120+ /// Replies to all pending resolve requests .
121121 ///
122122 /// This is a no-op if no requests are queued. Replies `Ok` if we have any known paths,
123123 /// otherwise with the provided `discovery_error` or with [`DiscoveryError::NoResults`].
@@ -139,10 +139,7 @@ impl EndpointPathState {
139139/// The state of a single path to the remote endpoint.
140140///
141141/// Each path is identified by the destination [`transports::Addr`] and they are stored in
142- /// the [`EndpointStateActor::paths`] map.
143- ///
144- /// [`transports::Addr`]: super::transports::Addr
145- /// [`EndpointStateActor::paths`]: super::endpoint_state::EndpointStateActor
142+ /// the [`EndpointPathState::paths`] map.
146143#[ derive( Debug , Default ) ]
147144pub ( super ) struct PathState {
148145 /// How we learned about this path, and when.
You can’t perform that action at this time.
0 commit comments