example work

This commit is contained in:
John Smith
2022-12-09 18:59:31 -05:00
parent 855a5a0756
commit 8c96373cfd
20 changed files with 713 additions and 30 deletions

View File

@@ -832,10 +832,12 @@ impl Network {
let mut editor = routing_table.edit_routing_domain(RoutingDomain::PublicInternet);
editor.clear_dial_info_details();
editor.set_network_class(None);
editor.commit().await;
let mut editor = routing_table.edit_routing_domain(RoutingDomain::LocalNetwork);
editor.clear_dial_info_details();
editor.set_network_class(None);
editor.commit().await;
// Reset state including network class

View File

@@ -290,6 +290,7 @@ impl Network {
protocol_config.inbound,
protocol_config.family_global,
);
editor_public_internet.set_network_class(Some(NetworkClass::WebApp));
// commit routing table edits
editor_public_internet.commit().await;
@@ -319,6 +320,7 @@ impl Network {
// Drop all dial info
let mut editor = routing_table.edit_routing_domain(RoutingDomain::PublicInternet);
editor.clear_dial_info_details();
editor.set_network_class(None);
editor.commit().await;
// Cancels all async background tasks by dropping join handles
@@ -348,15 +350,6 @@ impl Network {
false
}
pub fn get_network_class(&self, _routing_domain: RoutingDomain) -> Option<NetworkClass> {
// xxx eventually detect tor browser?
return if self.inner.lock().network_started {
Some(NetworkClass::WebApp)
} else {
None
};
}
pub fn get_protocol_config(&self) -> ProtocolConfig {
self.inner.lock().protocol_config.clone()
}