more semantics
This commit is contained in:
parent
e61d6be6a9
commit
4960d13447
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@ -3,4 +3,9 @@
|
|||||||
"python.analysis.extraPaths": [
|
"python.analysis.extraPaths": [
|
||||||
"veilid-python/.venv/lib/python3.11/site-packages"
|
"veilid-python/.venv/lib/python3.11/site-packages"
|
||||||
],
|
],
|
||||||
|
"rust-analyzer.linkedProjects": [
|
||||||
|
"./veilid-core/Cargo.toml",
|
||||||
|
"./veilid-core/Cargo.toml",
|
||||||
|
"./veilid-core/Cargo.toml"
|
||||||
|
],
|
||||||
}
|
}
|
@ -865,15 +865,19 @@ impl Network {
|
|||||||
|
|
||||||
debug!("clearing dial info");
|
debug!("clearing dial info");
|
||||||
|
|
||||||
let mut editor = routing_table.edit_routing_domain(RoutingDomain::PublicInternet);
|
routing_table
|
||||||
editor.clear_dial_info_details();
|
.edit_routing_domain(RoutingDomain::PublicInternet)
|
||||||
editor.set_network_class(None);
|
.clear_dial_info_details()
|
||||||
editor.commit();
|
.set_network_class(None)
|
||||||
|
.clear_relay_node()
|
||||||
|
.commit();
|
||||||
|
|
||||||
let mut editor = routing_table.edit_routing_domain(RoutingDomain::LocalNetwork);
|
routing_table
|
||||||
editor.clear_dial_info_details();
|
.edit_routing_domain(RoutingDomain::LocalNetwork)
|
||||||
editor.set_network_class(None);
|
.clear_dial_info_details()
|
||||||
editor.commit();
|
.set_network_class(None)
|
||||||
|
.clear_relay_node()
|
||||||
|
.commit();
|
||||||
|
|
||||||
// Reset state including network class
|
// Reset state including network class
|
||||||
*self.inner.lock() = Self::new_inner();
|
*self.inner.lock() = Self::new_inner();
|
||||||
|
@ -933,6 +933,7 @@ impl Network {
|
|||||||
// Network class could not be determined
|
// Network class could not be determined
|
||||||
editor.clear_dial_info_details();
|
editor.clear_dial_info_details();
|
||||||
editor.set_network_class(None);
|
editor.set_network_class(None);
|
||||||
|
editor.clear_relay_node();
|
||||||
changed = true;
|
changed = true;
|
||||||
log_net!(debug "PublicInternet network class cleared");
|
log_net!(debug "PublicInternet network class cleared");
|
||||||
}
|
}
|
||||||
|
@ -334,10 +334,13 @@ impl Network {
|
|||||||
let routing_table = self.routing_table();
|
let routing_table = self.routing_table();
|
||||||
|
|
||||||
// Drop all dial info
|
// Drop all dial info
|
||||||
let mut editor = routing_table.edit_routing_domain(RoutingDomain::PublicInternet);
|
routing_table
|
||||||
editor.clear_dial_info_details();
|
.edit_routing_domain(RoutingDomain::PublicInternet)
|
||||||
editor.set_network_class(None);
|
.clear_dial_info_details()
|
||||||
editor.commit().await;
|
.set_network_class(None)
|
||||||
|
.clear_relay_node()
|
||||||
|
.commit()
|
||||||
|
.await;
|
||||||
|
|
||||||
// Cancels all async background tasks by dropping join handles
|
// Cancels all async background tasks by dropping join handles
|
||||||
*self.inner.lock() = Self::new_inner();
|
*self.inner.lock() = Self::new_inner();
|
||||||
|
@ -9,10 +9,6 @@ impl RoutingTable {
|
|||||||
_last_ts: Timestamp,
|
_last_ts: Timestamp,
|
||||||
cur_ts: Timestamp,
|
cur_ts: Timestamp,
|
||||||
) -> EyreResult<()> {
|
) -> EyreResult<()> {
|
||||||
// Get our node's current node info and network class and do the right thing
|
|
||||||
if !self.has_valid_network_class(RoutingDomain::PublicInternet) {
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
let own_peer_info = self.get_own_peer_info(RoutingDomain::PublicInternet);
|
let own_peer_info = self.get_own_peer_info(RoutingDomain::PublicInternet);
|
||||||
let own_node_info = own_peer_info.signed_node_info().node_info();
|
let own_node_info = own_peer_info.signed_node_info().node_info();
|
||||||
let network_class = own_node_info.network_class();
|
let network_class = own_node_info.network_class();
|
||||||
@ -48,6 +44,15 @@ impl RoutingTable {
|
|||||||
);
|
);
|
||||||
editor.clear_relay_node();
|
editor.clear_relay_node();
|
||||||
false
|
false
|
||||||
|
}
|
||||||
|
// Should not have relay for invalid network class
|
||||||
|
else if !self.has_valid_network_class(RoutingDomain::PublicInternet) {
|
||||||
|
info!(
|
||||||
|
"Invalid network class does not get a relay, dropping relay {}",
|
||||||
|
relay_node
|
||||||
|
);
|
||||||
|
editor.clear_relay_node();
|
||||||
|
false
|
||||||
} else {
|
} else {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user