Add support for anonymous mode

This mode was added in libtorrent v0.16 and should be used in
addition to a SOCKS5 proxy.
This commit is contained in:
Christophe Dumez
2011-09-20 20:15:47 +03:00
parent e83618a1b2
commit 5990615248
8 changed files with 118 additions and 5 deletions

View File

@@ -249,6 +249,10 @@ void EventManager::setGlobalPreferences(QVariantMap m) const {
pref.setLSDEnabled(m["lsd"].toBool());
if(m.contains("encryption"))
pref.setEncryptionSetting(m["encryption"].toInt());
#if LIBTORRENT_VERSION_MINOR >= 16
if(m.contains("anonymous_mode"))
pref.enableAnonymousMode(m["anonymous_mode"].toBool());
#endif
// Proxy
if(m.contains("proxy_type"))
pref.setProxyType(m["proxy_type"].toInt());
@@ -362,6 +366,9 @@ QVariantMap EventManager::getGlobalPreferences() const {
data["pex"] = pref.isPeXEnabled();
data["lsd"] = pref.isLSDEnabled();
data["encryption"] = pref.getEncryptionSetting();
#if LIBTORRENT_VERSION_MINOR >= 16
data["anonymous_mode"] = pref.isAnonymousModeEnabled();
#endif
// Proxy
data["proxy_type"] = pref.getProxyType();
data["proxy_ip"] = pref.getProxyIp();