mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-04 06:32:29 -06:00
FEATURE: Proxy can be disabled for peer connections
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -137,7 +137,7 @@ public slots:
|
||||
qreal getMaxRatioPerTorrent(const QString &hash, bool *usesGlobalRatio) const;
|
||||
void removeRatioPerTorrent(const QString &hash);
|
||||
void setDHTPort(int dht_port);
|
||||
void setProxySettings(const libtorrent::proxy_settings &proxySettings);
|
||||
void setProxySettings(libtorrent::proxy_settings proxySettings);
|
||||
void setSessionSettings(const libtorrent::session_settings &sessionSettings);
|
||||
void startTorrentsInPause(bool b);
|
||||
void setDefaultTempPath(QString temppath);
|
||||
|
||||
Reference in New Issue
Block a user