From 500c2f32ebadb31a7c06f997424fbad17d57d94d Mon Sep 17 00:00:00 2001 From: John Smith Date: Fri, 16 Dec 2022 22:07:05 -0500 Subject: [PATCH] wasm fixes --- veilid-core/src/network_manager/wasm/mod.rs | 10 +++++----- veilid-wasm/src/lib.rs | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/veilid-core/src/network_manager/wasm/mod.rs b/veilid-core/src/network_manager/wasm/mod.rs index 8bdc2ec6..e5db561e 100644 --- a/veilid-core/src/network_manager/wasm/mod.rs +++ b/veilid-core/src/network_manager/wasm/mod.rs @@ -109,7 +109,7 @@ impl Network { // Network accounting self.network_manager() - .stats_packet_sent(dial_info.to_ip_addr(), data_len as u64); + .stats_packet_sent(dial_info.to_ip_addr(), ByteCount::new(data_len as u64)); Ok(NetworkResult::Value(())) } @@ -152,7 +152,7 @@ impl Network { network_result_try!(pnc.send(data).await.wrap_err("send failure")?); self.network_manager() - .stats_packet_sent(dial_info.to_ip_addr(), data_len as u64); + .stats_packet_sent(dial_info.to_ip_addr(), ByteCount::new(data_len as u64)); let out = network_result_try!(network_result_try!(timeout(timeout_ms, pnc.recv()) .await @@ -160,7 +160,7 @@ impl Network { .wrap_err("recv failure")?); self.network_manager() - .stats_packet_rcvd(dial_info.to_ip_addr(), out.len() as u64); + .stats_packet_rcvd(dial_info.to_ip_addr(), ByteCount::new(out.len() as u64)); Ok(NetworkResult::Value(out)) } @@ -194,7 +194,7 @@ impl Network { // Network accounting self.network_manager().stats_packet_sent( descriptor.remote().to_socket_addr().ip(), - data_len as u64, + ByteCount::new(data_len as u64), ); // Data was consumed @@ -243,7 +243,7 @@ impl Network { // Network accounting self.network_manager() - .stats_packet_sent(dial_info.to_ip_addr(), data_len as u64); + .stats_packet_sent(dial_info.to_ip_addr(), ByteCount::new(data_len as u64)); Ok(NetworkResult::value(connection_descriptor)) } diff --git a/veilid-wasm/src/lib.rs b/veilid-wasm/src/lib.rs index 12842756..bb0fc72f 100644 --- a/veilid-wasm/src/lib.rs +++ b/veilid-wasm/src/lib.rs @@ -16,7 +16,6 @@ use js_sys::*; use lazy_static::*; use send_wrapper::*; use serde::*; -use tracing::*; use tracing_subscriber::prelude::*; use tracing_subscriber::*; use tracing_wasm::{WASMLayerConfigBuilder, *};