Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
neonphog committed Jul 10, 2024
1 parent 49a7a9e commit 89bb5e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions rust/sbd-client/src/send_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ impl SendBuf {

/// We received a new rate limit from the server, update our records.
pub fn new_rate_limit(&mut self, limit: u64) {
/*
-- This was premature and caused some client lockups.
-- I'm going to leave the code in here for now as
-- an example of a naive solution that did *not* work,
-- in case we see that bumping rate limits on new
-- connections does indeed cause bad ratelimit drops.
if limit < self.limit_rate {
// rate limit updates are sent on a best effort,
// and there are network timing conditions to worry about.
Expand All @@ -70,6 +78,9 @@ impl SendBuf {
self.next_send_at = std::cmp::max(now, self.next_send_at)
+ (MAX_MSG_SIZE as u64 * self.limit_rate);
}
*/

self.limit_rate = limit;
let kbps = (8_000_000.0 / limit as f64) as u64;
let next_send_s = self.next_send_at as f64 / 1_000_000_000.0;
Expand Down
2 changes: 1 addition & 1 deletion ts/sbd-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"deploy": "wrangler deploy",
"deploy": "wrangler deploy --minify",
"dev": "wrangler dev",
"start": "wrangler dev",
"test:fmt": "prettier -w src",
Expand Down

0 comments on commit 89bb5e4

Please sign in to comment.