|
|
@ -1828,9 +1828,10 @@ void Session::setProxySettings(libt::proxy_settings proxySettings) |
|
|
|
proxySettings.proxy_peer_connections = Preferences::instance()->proxyPeerConnections(); |
|
|
|
proxySettings.proxy_peer_connections = Preferences::instance()->proxyPeerConnections(); |
|
|
|
m_nativeSession->set_proxy(proxySettings); |
|
|
|
m_nativeSession->set_proxy(proxySettings); |
|
|
|
|
|
|
|
|
|
|
|
// Define environment variable for urllib in search engine plugins
|
|
|
|
// Define environment variables for urllib in search engine plugins
|
|
|
|
if (Preferences::instance()->isProxyOnlyForTorrents()) { |
|
|
|
if (Preferences::instance()->isProxyOnlyForTorrents()) { |
|
|
|
qputenv("http_proxy", QByteArray()); |
|
|
|
qputenv("http_proxy", QByteArray()); |
|
|
|
|
|
|
|
qputenv("https_proxy", QByteArray()); |
|
|
|
qputenv("sock_proxy", QByteArray()); |
|
|
|
qputenv("sock_proxy", QByteArray()); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
@ -1853,14 +1854,17 @@ void Session::setProxySettings(libt::proxy_settings proxySettings) |
|
|
|
default: |
|
|
|
default: |
|
|
|
qDebug("Disabling HTTP communications proxy"); |
|
|
|
qDebug("Disabling HTTP communications proxy"); |
|
|
|
qputenv("http_proxy", QByteArray()); |
|
|
|
qputenv("http_proxy", QByteArray()); |
|
|
|
|
|
|
|
qputenv("https_proxy", QByteArray()); |
|
|
|
qputenv("sock_proxy", QByteArray()); |
|
|
|
qputenv("sock_proxy", QByteArray()); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
qDebug("HTTP communications proxy string: %s", qPrintable(proxy_str)); |
|
|
|
qDebug("HTTP communications proxy string: %s", qPrintable(proxy_str)); |
|
|
|
if ((proxySettings.type == libt::proxy_settings::socks5) || (proxySettings.type == libt::proxy_settings::socks5_pw)) |
|
|
|
if ((proxySettings.type == libt::proxy_settings::socks5) || (proxySettings.type == libt::proxy_settings::socks5_pw)) |
|
|
|
qputenv("sock_proxy", proxy_str.toLocal8Bit()); |
|
|
|
qputenv("sock_proxy", proxy_str.toLocal8Bit()); |
|
|
|
else |
|
|
|
else { |
|
|
|
qputenv("http_proxy", proxy_str.toLocal8Bit()); |
|
|
|
qputenv("http_proxy", proxy_str.toLocal8Bit()); |
|
|
|
|
|
|
|
qputenv("https_proxy", proxy_str.toLocal8Bit()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|