diff --git a/proxmox-http/Cargo.toml b/proxmox-http/Cargo.toml index 745deccb..a9ab364f 100644 --- a/proxmox-http/Cargo.toml +++ b/proxmox-http/Cargo.toml @@ -36,7 +36,6 @@ rate-limited-stream = [ "dep:tokio", "hyper?/client", "rate-limiter", - "tokio?/net", "tokio?/time", ] client = [ diff --git a/proxmox-http/src/rate_limited_stream.rs b/proxmox-http/src/rate_limited_stream.rs index c3756ddf..78b435ba 100644 --- a/proxmox-http/src/rate_limited_stream.rs +++ b/proxmox-http/src/rate_limited_stream.rs @@ -29,12 +29,6 @@ pub struct RateLimitedStream { stream: S, } -impl RateLimitedStream { - pub fn peer_addr(&self) -> std::io::Result { - self.stream.peer_addr() - } -} - impl RateLimitedStream { /// Creates a new instance with reads and writes limited to the same `rate`. pub fn new(stream: S, rate: u64, bucket_size: u64) -> Self { @@ -97,6 +91,14 @@ impl RateLimitedStream { } } } + + pub fn inner(&self) -> &S { + &self.stream + } + + pub fn inner_mut(&mut self) -> &mut S { + &mut self.stream + } } fn register_traffic(limiter: &(dyn ShareableRateLimit), count: usize) -> Option>> {