Commit Graph

15 Commits

Author SHA1 Message Date
Dietmar Maurer
b9a1d62e47 proxmox-http: RateLimit - remove average_rate
Instead, add a method to return overall traffic.
2021-11-14 08:15:42 +01:00
Dietmar Maurer
13276cc619 proxmox-http: use repr(C) for RateLimiter
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-13 17:38:18 +01:00
Dietmar Maurer
8734d0c2f9 proxmox-http: use SharedRateLimit trait object for RateLimitedStream
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-13 17:38:10 +01:00
Dietmar Maurer
937d1a6095 proxmox-http: define a RateLimit trait
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-13 17:38:00 +01:00
Dietmar Maurer
2f221df863 RateLimiter: add update_rate method 2021-11-10 09:51:08 +01:00
Dietmar Maurer
0c27d5da17 RateLimitedStream: implement peer_addr 2021-11-10 09:51:08 +01:00
Dietmar Maurer
e0a9982dd1 RateLimiter: avoid panic in time computations 2021-11-10 09:51:08 +01:00
Dietmar Maurer
e0305f724b RateLimitedStream: allow periodic limiter updates 2021-11-10 09:51:08 +01:00
Dietmar Maurer
00ca0b7fae HttpsConnector: use RateLimitedStream
So that we can limit used bandwidth.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-10 09:51:08 +01:00
Dietmar Maurer
ded24b3f4c RateLimitedStream: implement poll_write_vectored
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-10 09:51:08 +01:00
Dietmar Maurer
c94ad247b1 Implement a rate limiting stream (AsyncRead, AsyncWrite)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-10 09:51:08 +01:00
Wolfgang Bumiller
e0dcc337ac rustfmt fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-05-17 12:25:49 +02:00
Wolfgang Bumiller
76c25a9612 add some more module level docs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-05-17 11:25:42 +02:00
Wolfgang Bumiller
c9b4a4f39b uri: drop anyhow::Error and improve docs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-05-17 11:25:42 +02:00
Wolfgang Bumiller
ca9dd7ec36 reorganize crate
it's a 'http' utility crate
* the extra 'http' module is redundant
* the module name 'helpers' as a public path doesn't say
  much about what it does

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-05-17 11:03:31 +02:00