mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
fix(network): fall back to unlimited bandwidth in case the legacy global limit is still set
`-2` used to mean "Use global limits", which no longer exist since 3.17.0. As any negative value results in the auto bandwidth limiter to engage, this could result in unexpected slower sync speeds after a client upgrade. Let's just keep handling that value and assume that we want to use unlimited bandwidth. Fixes #8743 Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org> [skip ci]
This commit is contained in:
parent
4f7cd8fe7e
commit
004b09af90
@ -1314,7 +1314,14 @@ void Account::setUploadLimitSetting(const AccountNetworkTransferLimitSetting set
|
||||
return;
|
||||
}
|
||||
|
||||
_uploadLimitSetting = setting;
|
||||
auto targetSetting = setting;
|
||||
|
||||
if (setting == AccountNetworkTransferLimitSetting::LegacyGlobalLimit) {
|
||||
qCInfo(lcAccount) << "Upload limit setting was requested to be set to the legacy global limit, falling back to unlimited";
|
||||
targetSetting = AccountNetworkTransferLimitSetting::NoLimit;
|
||||
}
|
||||
|
||||
_uploadLimitSetting = targetSetting;
|
||||
emit uploadLimitSettingChanged();
|
||||
}
|
||||
|
||||
@ -1328,8 +1335,15 @@ void Account::setDownloadLimitSetting(const AccountNetworkTransferLimitSetting s
|
||||
if (setting == _downloadLimitSetting) {
|
||||
return;
|
||||
}
|
||||
|
||||
_downloadLimitSetting = setting;
|
||||
|
||||
auto targetSetting = setting;
|
||||
|
||||
if (setting == AccountNetworkTransferLimitSetting::LegacyGlobalLimit) {
|
||||
qCInfo(lcAccount) << "Download limit setting was requested to be set to the legacy global limit, falling back to unlimited";
|
||||
targetSetting = AccountNetworkTransferLimitSetting::NoLimit;
|
||||
}
|
||||
|
||||
_downloadLimitSetting = targetSetting;
|
||||
emit downloadLimitSettingChanged();
|
||||
}
|
||||
|
||||
|
||||
@ -98,6 +98,7 @@ class OWNCLOUDSYNC_EXPORT Account : public QObject
|
||||
|
||||
public:
|
||||
enum class AccountNetworkTransferLimitSetting {
|
||||
LegacyGlobalLimit = -2, // Until 3.17.0 a value of -2 was interpreted as "Use global network settings", it's now used to fall back to "No limit". See also GH#8743
|
||||
AutoLimit = -1, // Value under 0 is interpreted as auto in general
|
||||
NoLimit,
|
||||
ManualLimit,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user