From 22da17f13fdd7c819bbea025939adcadf57bcc23 Mon Sep 17 00:00:00 2001 From: tearfur <46261767+tearfur@users.noreply.github.com> Date: Wed, 26 Jul 2023 00:53:33 +0800 Subject: [PATCH] fix: clamp down harder for upload as well (#5821) --- libtransmission/bandwidth.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libtransmission/bandwidth.cc b/libtransmission/bandwidth.cc index 99626c83a..37e6df2ed 100644 --- a/libtransmission/bandwidth.cc +++ b/libtransmission/bandwidth.cc @@ -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(current) / desired : 0.0; if (r > 1.0)