From 28b3b841a3f98bef959befa5e8a2453e71fe9c0b Mon Sep 17 00:00:00 2001 From: John Smith Date: Sat, 6 Aug 2022 13:59:50 -0400 Subject: [PATCH] last connection work --- .../src/network_manager/native/network_class_discovery.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/veilid-core/src/network_manager/native/network_class_discovery.rs b/veilid-core/src/network_manager/native/network_class_discovery.rs index 1468785c..5366565a 100644 --- a/veilid-core/src/network_manager/native/network_class_discovery.rs +++ b/veilid-core/src/network_manager/native/network_class_discovery.rs @@ -78,10 +78,13 @@ impl DiscoveryContext { #[instrument(level = "trace", skip(self), ret)] async fn request_public_address(&self, node_ref: NodeRef) -> Option { let rpc = self.routing_table.rpc_processor(); + + // Ensure we ask for a fresh connection + node_ref.clear_last_connection(); + let res = network_result_value_or_log!(debug match rpc.rpc_call_status(node_ref.clone()).await { Ok(v) => v, Err(e) => { - node_ref.clear_last_connection(); log_net!(error "failed to get status answer from {:?}: {}", node_ref, e @@ -89,12 +92,10 @@ impl DiscoveryContext { return None; } } => { - node_ref.clear_last_connection(); return None; } ); - node_ref.clear_last_connection(); log_net!( "request_public_address {:?}: Value({:?})", node_ref, @@ -209,7 +210,6 @@ impl DiscoveryContext { node_ref )) .unwrap_or(false); - node_ref.clear_last_connection(); out }