From 09f999337afc28e36c11adcda2eb07e54c6528ae Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sun, 14 Nov 2021 08:27:45 +0100 Subject: [PATCH] update to proxmox-http 0.5.4 Signed-off-by: Dietmar Maurer --- Cargo.toml | 2 +- pbs-client/Cargo.toml | 2 +- src/shared_rate_limiter.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e103f42e1..50c6075f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,7 +98,7 @@ pathpatterns = "0.1.2" pxar = { version = "0.10.1", features = [ "tokio-io" ] } proxmox = { version = "0.15.0", features = [ "sortable-macro" ] } -proxmox-http = { version = "0.5.3", features = [ "client", "http-helpers", "websocket" ] } +proxmox-http = { version = "0.5.4", features = [ "client", "http-helpers", "websocket" ] } proxmox-io = "1" proxmox-lang = "1" proxmox-router = { version = "1.1", features = [ "cli" ] } diff --git a/pbs-client/Cargo.toml b/pbs-client/Cargo.toml index 4f6614adb..2fb05ca4a 100644 --- a/pbs-client/Cargo.toml +++ b/pbs-client/Cargo.toml @@ -30,7 +30,7 @@ xdg = "2.2" pathpatterns = "0.1.2" proxmox = "0.15.0" proxmox-fuse = "0.1.1" -proxmox-http = { version = "0.5.3", features = [ "client", "http-helpers", "websocket" ] } +proxmox-http = { version = "0.5.4", features = [ "client", "http-helpers", "websocket" ] } proxmox-io = { version = "1", features = [ "tokio" ] } proxmox-lang = "1" proxmox-router = { version = "1.1", features = [ "cli" ] } diff --git a/src/shared_rate_limiter.rs b/src/shared_rate_limiter.rs index 3c282c85f..1ca4c7b77 100644 --- a/src/shared_rate_limiter.rs +++ b/src/shared_rate_limiter.rs @@ -31,7 +31,7 @@ impl Init for WrapLimiter { struct SharedRateLimiterData { magic: [u8; 8], tbf: SharedMutex, - padding: [u8; 4096 - 120], + padding: [u8; 4096 - 104], } impl Init for SharedRateLimiterData { @@ -98,9 +98,9 @@ impl ShareableRateLimit for SharedRateLimiter { .update_rate(rate, bucket_size); } - fn average_rate(&self, current_time: Instant) -> f64 { + fn traffic(&self) -> u64 { self.shmem.data().tbf.lock().0 - .average_rate(current_time) + .traffic() } fn register_traffic(&self, current_time: Instant, data_len: u64) -> Duration {