mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
FEATURE: Proxy can be disabled for peer connections
This commit is contained in:
parent
18e08c319f
commit
65883317c3
39 changed files with 2354 additions and 2020 deletions
|
@ -2022,17 +2022,22 @@ void QBtSession::setSessionSettings(const session_settings &sessionSettings) {
|
|||
}
|
||||
|
||||
// Set Proxy
|
||||
void QBtSession::setProxySettings(const proxy_settings &proxySettings) {
|
||||
void QBtSession::setProxySettings(proxy_settings proxySettings) {
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
#if (LIBTORRENT_VERSION_MINOR > 15) || (LIBTORRENT_VERSION_MINOR == 15 && LIBTORRENT_VERSION_TINY > 4)
|
||||
#if LIBTORRENT_VERSION_MINOR > 15
|
||||
proxySettings.proxy_peer_connections = Preferences().proxyPeerConnections();
|
||||
s->set_proxy(proxySettings);
|
||||
#else
|
||||
s->set_peer_proxy(proxySettings);
|
||||
s->set_web_seed_proxy(proxySettings);
|
||||
s->set_tracker_proxy(proxySettings);
|
||||
s->set_dht_proxy(proxySettings);
|
||||
proxy_settings peer_proxy;
|
||||
if (Preferences().proxyPeerConnections())
|
||||
peer_proxy = proxySettings;
|
||||
s->set_peer_proxy(peer_proxy);
|
||||
s->set_web_seed_proxy(peer_proxy);
|
||||
s->set_dht_proxy(peer_proxy);
|
||||
#endif
|
||||
|
||||
// Define environment variable
|
||||
QString proxy_str;
|
||||
switch(proxySettings.type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue