Skip to content

Commit

Permalink
fix: clamp down harder for upload as well (#5821)
Browse files Browse the repository at this point in the history
  • Loading branch information
tearfur committed Jul 25, 2023
1 parent d7473f2 commit 22da17f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libtransmission/bandwidth.cc
Expand Up @@ -277,8 +277,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->get_raw_speed_bytes_per_second(now, TR_DOWN);
auto const desired = this->get_desired_speed_bytes_per_second(TR_DOWN);
auto const current = this->get_raw_speed_bytes_per_second(now, dir);
auto const desired = this->get_desired_speed_bytes_per_second(dir);
auto const r = desired >= 1 ? static_cast<double>(current) / desired : 0.0;

if (r > 1.0)
Expand Down

0 comments on commit 22da17f

Please sign in to comment.