[pbs-devel] [PATCH proxmox 6/7] RateLimitedStream: implement peer_addr

Dietmar Maurer dietmar at proxmox.com
Tue Nov 9 07:52:49 CET 2021


---
 proxmox-http/src/client/rate_limited_stream.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/proxmox-http/src/client/rate_limited_stream.rs b/proxmox-http/src/client/rate_limited_stream.rs
index ea99383..865a426 100644
--- a/proxmox-http/src/client/rate_limited_stream.rs
+++ b/proxmox-http/src/client/rate_limited_stream.rs
@@ -24,6 +24,12 @@ pub struct RateLimitedStream<S> {
     stream: S,
 }
 
+impl RateLimitedStream<tokio::net::TcpStream> {
+    pub fn peer_addr(&self) -> std::io::Result<std::net::SocketAddr> {
+        self.stream.peer_addr()
+    }
+}
+
 impl <S> RateLimitedStream<S> {
 
     /// Creates a new instance with reads and writes limited to the same `rate`.
-- 
2.30.2






More information about the pbs-devel mailing list