Range-check global throttle rates before narrowing them to kB.

Multiplying kB back to bytes in unsigned int wrapped 2^32 to 0, which means unlimited.
This commit is contained in:
xirvik
2026-09-19 00:55:27 +00:00
committed by Jari Sundell
parent 05cdd03cd2
commit 83b03c2c1e
5 changed files with 151 additions and 8 deletions
-4
View File
@@ -70,10 +70,6 @@ public:
void set_down_throttle(unsigned int throttle);
void set_up_throttle(unsigned int throttle);
// Rename to raw or something, make base function.
void set_down_throttle_i64(int64_t throttle) { set_down_throttle(throttle >> 10); }
void set_up_throttle_i64(int64_t throttle) { set_up_throttle(throttle >> 10); }
void adjust_down_throttle(int throttle);
void adjust_up_throttle(int throttle);