From 292712671ae513755a310f3b6ed8fa3f584c5bf0 Mon Sep 17 00:00:00 2001 From: John Smith Date: Sat, 6 Aug 2022 13:15:33 -0400 Subject: [PATCH] last connection work --- .../native/network_class_discovery.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 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 d2b0568b..1468785c 100644 --- a/veilid-core/src/network_manager/native/network_class_discovery.rs +++ b/veilid-core/src/network_manager/native/network_class_discovery.rs @@ -81,15 +81,20 @@ impl DiscoveryContext { 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 ); return None; } - } => { return None; } + } => { + node_ref.clear_last_connection(); + return None; + } ); + node_ref.clear_last_connection(); log_net!( "request_public_address {:?}: Value({:?})", node_ref, @@ -196,13 +201,16 @@ impl DiscoveryContext { node_ref.set_filter(None); // ask the node to send us a dial info validation receipt - rpc.rpc_call_validate_dial_info(node_ref.clone(), dial_info, redirect) + let out = rpc + .rpc_call_validate_dial_info(node_ref.clone(), dial_info, redirect) .await .map_err(logthru_net!( "failed to send validate_dial_info to {:?}", node_ref )) - .unwrap_or(false) + .unwrap_or(false); + node_ref.clear_last_connection(); + out } #[instrument(level = "trace", skip(self), ret)]