mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 06:28:03 -06:00
Add a "Use proxy for hostname lookup" option
Add a UI option for "Use proxy for hostname lookup" option and plumb it into libtorrent's settings_pack.proxy_hostnames option. This is available for SOCKS5 and HTTP proxies, and defaults to true, which is the previous functionality. Hostname lookups can be forced to be local by unchecking this option, which can aid compatibility with certain non-compliant proxy servers. Closes #17902. PR #17904. Co-authored-by: Nathan Lewis <saturn@saturn49.dyndns.org>
This commit is contained in:
@@ -475,6 +475,7 @@ SessionImpl::SessionImpl(QObject *parent)
|
||||
, m_encryption(BITTORRENT_SESSION_KEY(u"Encryption"_qs), 0)
|
||||
, m_maxActiveCheckingTorrents(BITTORRENT_SESSION_KEY(u"MaxActiveCheckingTorrents"_qs), 1)
|
||||
, m_isProxyPeerConnectionsEnabled(BITTORRENT_SESSION_KEY(u"ProxyPeerConnections"_qs), false)
|
||||
, m_isProxyHostnameLookupEnabled(BITTORRENT_SESSION_KEY(u"ProxyHostnameLookup"_qs), true)
|
||||
, m_chokingAlgorithm(BITTORRENT_SESSION_KEY(u"ChokingAlgorithm"_qs), ChokingAlgorithm::FixedSlots
|
||||
, clampValue(ChokingAlgorithm::FixedSlots, ChokingAlgorithm::RateBased))
|
||||
, m_seedChokingAlgorithm(BITTORRENT_SESSION_KEY(u"SeedChokingAlgorithm"_qs), SeedChokingAlgorithm::FastestUpload
|
||||
@@ -1644,6 +1645,7 @@ void SessionImpl::loadLTSettings(lt::settings_pack &settingsPack)
|
||||
}
|
||||
|
||||
settingsPack.set_bool(lt::settings_pack::proxy_peer_connections, isProxyPeerConnectionsEnabled());
|
||||
settingsPack.set_bool(lt::settings_pack::proxy_hostnames, isProxyHostnameLookupEnabled());
|
||||
}
|
||||
|
||||
settingsPack.set_bool(lt::settings_pack::announce_to_all_trackers, announceToAllTrackers());
|
||||
@@ -3442,6 +3444,20 @@ void SessionImpl::setProxyPeerConnectionsEnabled(const bool enabled)
|
||||
}
|
||||
}
|
||||
|
||||
bool SessionImpl::isProxyHostnameLookupEnabled() const
|
||||
{
|
||||
return m_isProxyHostnameLookupEnabled;
|
||||
}
|
||||
|
||||
void SessionImpl::setProxyHostnameLookupEnabled(const bool enabled)
|
||||
{
|
||||
if (enabled != isProxyHostnameLookupEnabled())
|
||||
{
|
||||
m_isProxyHostnameLookupEnabled = enabled;
|
||||
configureDeferred();
|
||||
}
|
||||
}
|
||||
|
||||
ChokingAlgorithm SessionImpl::chokingAlgorithm() const
|
||||
{
|
||||
return m_chokingAlgorithm;
|
||||
|
||||
Reference in New Issue
Block a user