Browse Source

Remove settings to exchange trackers. It wasn't used by non-libtorrent clients. Also it has a privacy risk and you might be DDoSing someone. DHT makes it obsolete anyway.

adaptive-webui-19844
sledgehammer999 8 years ago
parent
commit
a092cb9bda
No known key found for this signature in database
GPG Key ID: 6E4A2D025B7CC9A2
  1. 17
      src/base/bittorrent/session.cpp
  2. 8
      src/base/bittorrent/session.h
  3. 1
      src/base/settingsstorage.cpp
  4. 6
      src/gui/advancedsettings.cpp
  5. 2
      src/gui/advancedsettings.h

17
src/base/bittorrent/session.cpp

@ -55,7 +55,6 @@ @@ -55,7 +55,6 @@
#include <libtorrent/bencode.hpp>
#include <libtorrent/error_code.hpp>
#include <libtorrent/extensions/ut_metadata.hpp>
#include <libtorrent/extensions/lt_trackers.hpp>
#include <libtorrent/extensions/ut_pex.hpp>
#include <libtorrent/extensions/smart_ban.hpp>
#include <libtorrent/identify_client.hpp>
@ -213,7 +212,6 @@ Session::Session(QObject *parent) @@ -213,7 +212,6 @@ Session::Session(QObject *parent)
, m_isDHTEnabled(BITTORRENT_SESSION_KEY("DHTEnabled"), true)
, m_isLSDEnabled(BITTORRENT_SESSION_KEY("LSDEnabled"), true)
, m_isPeXEnabled(BITTORRENT_SESSION_KEY("PeXEnabled"), true)
, m_isTrackerExchangeEnabled(BITTORRENT_SESSION_KEY("TrackerExchangeEnabled"), false)
, m_isIPFilteringEnabled(BITTORRENT_SESSION_KEY("IPFilteringEnabled"), false)
, m_isTrackerFilteringEnabled(BITTORRENT_SESSION_KEY("TrackerFilteringEnabled"), false)
, m_IPFilterFile(BITTORRENT_SESSION_KEY("IPFilter"))
@ -278,7 +276,6 @@ Session::Session(QObject *parent) @@ -278,7 +276,6 @@ Session::Session(QObject *parent)
, m_isTrackerEnabled(BITTORRENT_KEY("TrackerEnabled"), false)
, m_bannedIPs("State/BannedIPs")
, m_wasPexEnabled(m_isPeXEnabled)
, m_wasTrackerExchangeEnabled(m_isTrackerExchangeEnabled)
, m_numResumeData(0)
, m_extraLimit(0)
, m_useProxy(false)
@ -365,8 +362,6 @@ Session::Session(QObject *parent) @@ -365,8 +362,6 @@ Session::Session(QObject *parent)
// Enabling plugins
//m_nativeSession->add_extension(&libt::create_metadata_plugin);
m_nativeSession->add_extension(&libt::create_ut_metadata_plugin);
if (isTrackerExchangeEnabled())
m_nativeSession->add_extension(&libt::create_lt_trackers_plugin);
if (isPeXEnabled())
m_nativeSession->add_extension(&libt::create_ut_pex_plugin);
m_nativeSession->add_extension(&libt::create_smart_ban_plugin);
@ -475,18 +470,6 @@ void Session::setPeXEnabled(bool enabled) @@ -475,18 +470,6 @@ void Session::setPeXEnabled(bool enabled)
Logger::instance()->addMessage(tr("Restart is required to toggle PeX support"), Log::WARNING);
}
bool Session::isTrackerExchangeEnabled() const
{
return m_isTrackerExchangeEnabled;
}
void Session::setTrackerExchangeEnabled(bool enabled)
{
m_isTrackerExchangeEnabled = enabled;
if (m_wasTrackerExchangeEnabled != enabled)
Logger::instance()->addMessage(tr("Restart is required to toggle Tracker Exchange support"), Log::WARNING);
}
bool Session::isTempPathEnabled() const
{
return m_isTempPathEnabled;

8
src/base/bittorrent/session.h

@ -218,8 +218,6 @@ namespace BitTorrent @@ -218,8 +218,6 @@ namespace BitTorrent
void setLSDEnabled(bool enabled);
bool isPeXEnabled() const;
void setPeXEnabled(bool enabled);
bool isTrackerExchangeEnabled() const;
void setTrackerExchangeEnabled(bool enabled);
bool isAddTorrentPaused() const;
void setAddTorrentPaused(bool value);
bool isTrackerEnabled() const;
@ -507,7 +505,6 @@ namespace BitTorrent @@ -507,7 +505,6 @@ namespace BitTorrent
CachedSettingValue<bool> m_isDHTEnabled;
CachedSettingValue<bool> m_isLSDEnabled;
CachedSettingValue<bool> m_isPeXEnabled;
CachedSettingValue<bool> m_isTrackerExchangeEnabled;
CachedSettingValue<bool> m_isIPFilteringEnabled;
CachedSettingValue<bool> m_isTrackerFilteringEnabled;
CachedSettingValue<QString> m_IPFilterFile;
@ -572,11 +569,10 @@ namespace BitTorrent @@ -572,11 +569,10 @@ namespace BitTorrent
CachedSettingValue<bool> m_isTrackerEnabled;
CachedSettingValue<QStringList> m_bannedIPs;
// Order is important. These need to be declared after their CachedSettingsValue
// counterparts, because they use them for initialization in the constructor
// Order is important. This needs to be declared after its CachedSettingsValue
// counterpart, because it uses it for initialization in the constructor
// initialization list.
const bool m_wasPexEnabled;
const bool m_wasTrackerExchangeEnabled;
int m_numResumeData;
int m_extraLimit;

1
src/base/settingsstorage.cpp

@ -127,7 +127,6 @@ namespace @@ -127,7 +127,6 @@ namespace
{"BitTorrent/Session/DHTEnabled", "Preferences/Bittorrent/DHT"},
{"BitTorrent/Session/LSDEnabled", "Preferences/Bittorrent/LSD"},
{"BitTorrent/Session/PeXEnabled", "Preferences/Bittorrent/PeX"},
{"BitTorrent/Session/TrackerExchangeEnabled", "Preferences/Advanced/LtTrackerExchange"},
{"BitTorrent/Session/AddTrackersEnabled", "Preferences/Bittorrent/AddTrackers"},
{"BitTorrent/Session/AdditionalTrackers", "Preferences/Bittorrent/TrackersList"},
{"BitTorrent/Session/IPFilteringEnabled", "Preferences/IPFilter/Enabled"},

6
src/gui/advancedsettings.cpp

@ -87,7 +87,6 @@ enum AdvSettingsRows @@ -87,7 +87,6 @@ enum AdvSettingsRows
// seeding
SUPER_SEEDING,
// tracker
TRACKER_EXCHANGE,
ANNOUNCE_ALL_TRACKERS,
ANNOUNCE_IP,
@ -186,8 +185,6 @@ void AdvancedSettings::saveAdvancedSettings() @@ -186,8 +185,6 @@ void AdvancedSettings::saveAdvancedSettings()
pref->useSystemIconTheme(cb_use_icon_theme.isChecked());
#endif
pref->setConfirmTorrentRecheck(cb_confirm_torrent_recheck.isChecked());
// Tracker exchange
session->setTrackerExchangeEnabled(cb_enable_tracker_ext.isChecked());
session->setAnnounceToAllTrackers(cb_announce_all_trackers.isChecked());
}
@ -380,9 +377,6 @@ void AdvancedSettings::loadAdvancedSettings() @@ -380,9 +377,6 @@ void AdvancedSettings::loadAdvancedSettings()
// Torrent recheck confirmation
cb_confirm_torrent_recheck.setChecked(pref->confirmTorrentRecheck());
addRow(CONFIRM_RECHECK_TORRENT, tr("Confirm torrent recheck"), &cb_confirm_torrent_recheck);
// Tracker exchange
cb_enable_tracker_ext.setChecked(session->isTrackerExchangeEnabled());
addRow(TRACKER_EXCHANGE, tr("Exchange trackers with other peers"), &cb_enable_tracker_ext);
// Announce to all trackers
cb_announce_all_trackers.setChecked(session->announceToAllTrackers());
addRow(ANNOUNCE_ALL_TRACKERS, tr("Always announce to all trackers"), &cb_announce_all_trackers);

2
src/gui/advancedsettings.h

@ -79,7 +79,7 @@ private: @@ -79,7 +79,7 @@ private:
QSpinBox spin_cache, spin_save_resume_data_interval, outgoing_ports_min, outgoing_ports_max, spin_list_refresh, spin_maxhalfopen, spin_tracker_port, spin_cache_ttl;
QCheckBox cb_os_cache, cb_recheck_completed, cb_resolve_countries, cb_resolve_hosts, cb_super_seeding,
cb_program_notifications, cb_torrent_added_notifications, cb_tracker_favicon, cb_tracker_status,
cb_confirm_torrent_recheck, cb_enable_tracker_ext, cb_listen_ipv6, cb_announce_all_trackers;
cb_confirm_torrent_recheck, cb_listen_ipv6, cb_announce_all_trackers;
QComboBox combo_iface, combo_iface_address;
QLineEdit txtAnnounceIP;

Loading…
Cancel
Save