Commit Graph

21 Commits

Author SHA1 Message Date
Thomas Lamprecht
0eeb0dd17c http: rustfmt
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-10 12:41:21 +02:00
Wolfgang Bumiller
70142e607d proxmox-http: drop 'mut' on specialized request methods
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-11 08:56:34 +01:00
Wolfgang Bumiller
c609a58086 doc fixups
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-02 14:14:09 +01:00
Wolfgang Bumiller
179515c5b2 http: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-12-07 11:45:52 +01:00
Dietmar Maurer
82245339b8 use new proxmox-sys 0.2.0 for all crates
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-24 10:00:38 +01:00
Dietmar Maurer
81e959548b proxmox-http: impl RateLimiterVec
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2021-11-15 11:01:03 +01:00
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