Skip to content

Commit

Permalink
Limit max bytes to 100000 in rate limiter calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
nullchinchilla committed Jan 5, 2025
1 parent 9e3a5f7 commit 61a53f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion binaries/geph5-exit/src/ratelimit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl RateLimiter {
}
let multiplier = (1.0 / (1.0 - get_load().min(0.999)) - 1.0) / 2.0;

let bytes = bytes as f32 * (multiplier.max(1.0));
let bytes = (bytes as f32 * (multiplier.max(1.0))).min(100000);
if let Some(inner) = &self.inner {
let mut delay: f32 = 0.005;
while inner
Expand Down

0 comments on commit 61a53f3

Please sign in to comment.