Avoid blocking call when changing libtorrent session settings

We don't really need to get currently used settings pack in order to apply changes to session settings. It is enough to apply settings pack that contains only updated settings.

PR #17989.
This commit is contained in:
Vladimir Golovnev 2022-11-09 08:02:34 +03:00 committed by GitHub
parent 2e4431f0b8
commit 6c9c40fd7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 49 deletions

View file

@ -474,11 +474,10 @@ namespace BitTorrent
Q_INVOKABLE void configure();
void configureComponents();
void initializeNativeSession();
void loadLTSettings(lt::settings_pack &settingsPack);
void configureNetworkInterfaces(lt::settings_pack &settingsPack);
lt::settings_pack loadLTSettings() const;
void applyNetworkInterfacesSettings(lt::settings_pack &settingsPack) const;
void configurePeerClasses();
void adjustLimits(lt::settings_pack &settingsPack) const;
void applyBandwidthLimits(lt::settings_pack &settingsPack) const;
int adjustLimit(int limit) const;
void initMetrics();
void adjustLimits();
void applyBandwidthLimits();
@ -553,7 +552,7 @@ namespace BitTorrent
bool m_deferredConfigureScheduled = false;
bool m_IPFilteringConfigured = false;
bool m_listenInterfaceConfigured = false;
mutable bool m_listenInterfaceConfigured = false;
CachedSettingValue<bool> m_isDHTEnabled;
CachedSettingValue<bool> m_isLSDEnabled;