fix: clamp down harder for upload as well (#5821)

This commit is contained in:
tearfur 2023-07-26 00:53:33 +08:00 committed by Charles Kerr
parent de26f38c77
commit 264746959b
1 changed files with 2 additions and 2 deletions

View File

@ -276,8 +276,8 @@ size_t tr_bandwidth::clamp(uint64_t now, tr_direction dir, size_t byte_count) co
now = tr_time_msec();
}
auto const current = this->getRawSpeedBytesPerSecond(now, TR_DOWN);
auto const desired = this->getDesiredSpeedBytesPerSecond(TR_DOWN);
auto const current = this->getRawSpeedBytesPerSecond(now, dir);
auto const desired = this->getDesiredSpeedBytesPerSecond(dir);
auto const r = desired >= 1 ? static_cast<double>(current) / desired : 0.0;
if (r > 1.0)