fix: speed limits did not work below 16KiB/s (#7339)

* refactor: calculate raw speed by OS buffer instead of application buffer

* refactor: limit transfer speed by raw speed

* refactor: early return write if no bytes

* refactor: remove code for guessing TCP/IP overhead

* refactor: remove code for uTP overhead
This commit is contained in:
Yat Ho
2024-12-29 15:42:07 +08:00
committed by GitHub
parent 536fe4a6e1
commit a4cc98b92c
6 changed files with 39 additions and 77 deletions

View File

@@ -183,7 +183,7 @@ public:
return false;
}
auto const got = get_piece_speed(now_msec, dir);
auto const got = get_raw_speed(now_msec, dir);
auto const want = get_desired_speed(dir);
return got >= want;
}