Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clamp down harder for upload as well #5821

Merged
merged 1 commit into from Jul 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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