wasm fixes

This commit is contained in:
John Smith
2023-03-12 12:24:21 -04:00
parent f8060715ce
commit 0ea858b08e
10 changed files with 84 additions and 74 deletions

View File

@@ -83,6 +83,7 @@ impl ConnectionTable {
unord.push(v);
}
}
inner.protocol_index_by_id.clear();
inner.id_by_descriptor.clear();
inner.ids_by_remote.clear();
unord

View File

@@ -542,7 +542,7 @@ impl RoutingTable {
}
/// Attempt to empty the routing table
/// should only be performed when there are no node_refs (detached)
/// May not empty buckets completely if there are existing node_refs
pub fn purge_buckets(&self) {
self.inner.write().purge_buckets();
}

View File

@@ -1,7 +1,7 @@
use super::*;
#[derive(Clone, Debug, RkyvArchive, RkyvSerialize, RkyvDeserialize)]
#[archive_attr(repr(C), derive(CheckBytes))]
#[archive_attr(repr(C, align(8)), derive(CheckBytes))]
pub struct RouteSpecDetail {
/// Crypto kind
pub crypto_kind: CryptoKind,
@@ -13,7 +13,7 @@ pub struct RouteSpecDetail {
}
#[derive(Clone, Debug, RkyvArchive, RkyvSerialize, RkyvDeserialize)]
#[archive_attr(repr(C), derive(CheckBytes))]
#[archive_attr(repr(C, align(8)), derive(CheckBytes))]
pub struct RouteSetSpecDetail {
/// Route set per crypto kind
route_set: BTreeMap<PublicKey, RouteSpecDetail>,

View File

@@ -471,13 +471,14 @@ impl VeilidAPI {
// Purge connection table
let connection_manager = self.network_manager()?.connection_manager();
connection_manager.shutdown().await;
connection_manager.startup().await;
// Eliminate last_connections from routing table entries
self.network_manager()?
.routing_table()
.purge_last_connections();
connection_manager.startup().await;
Ok("Connections purged".to_owned())
} else if args[0] == "routes" {
// Purge route spec store