mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-10 23:07:59 +00:00
Add allow_multiple_connections_per_ip knob. Closes #5884.
This commit is contained in:
parent
4185209036
commit
21ec8fe53f
@ -284,6 +284,7 @@ Session::Session(QObject *parent)
|
|||||||
, m_isUTPEnabled(BITTORRENT_SESSION_KEY("uTPEnabled"), true)
|
, m_isUTPEnabled(BITTORRENT_SESSION_KEY("uTPEnabled"), true)
|
||||||
, m_isUTPRateLimited(BITTORRENT_SESSION_KEY("uTPRateLimited"), true)
|
, m_isUTPRateLimited(BITTORRENT_SESSION_KEY("uTPRateLimited"), true)
|
||||||
, m_utpMixedMode(BITTORRENT_SESSION_KEY("uTPMixedMode"), m_isUTPEnabled)
|
, m_utpMixedMode(BITTORRENT_SESSION_KEY("uTPMixedMode"), m_isUTPEnabled)
|
||||||
|
, m_multiConnectionsPerIpEnabled(BITTORRENT_SESSION_KEY("MultiConnectionsPerIp"), false)
|
||||||
, m_isAddTrackersEnabled(BITTORRENT_SESSION_KEY("AddTrackersEnabled"), false)
|
, m_isAddTrackersEnabled(BITTORRENT_SESSION_KEY("AddTrackersEnabled"), false)
|
||||||
, m_additionalTrackers(BITTORRENT_SESSION_KEY("AdditionalTrackers"))
|
, m_additionalTrackers(BITTORRENT_SESSION_KEY("AdditionalTrackers"))
|
||||||
, m_globalMaxRatio(BITTORRENT_SESSION_KEY("GlobalMaxRatio"), -1, [](qreal r) { return r < 0 ? -1. : r;})
|
, m_globalMaxRatio(BITTORRENT_SESSION_KEY("GlobalMaxRatio"), -1, [](qreal r) { return r < 0 ? -1. : r;})
|
||||||
@ -1310,6 +1311,8 @@ void Session::configure(libtorrent::settings_pack &settingsPack)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
settingsPack.set_bool(libt::settings_pack::allow_multiple_connections_per_ip, multiConnectionsPerIpEnabled());
|
||||||
|
|
||||||
settingsPack.set_bool(libt::settings_pack::apply_ip_filter_to_trackers, isTrackerFilteringEnabled());
|
settingsPack.set_bool(libt::settings_pack::apply_ip_filter_to_trackers, isTrackerFilteringEnabled());
|
||||||
|
|
||||||
settingsPack.set_bool(libt::settings_pack::enable_dht, isDHTEnabled());
|
settingsPack.set_bool(libt::settings_pack::enable_dht, isDHTEnabled());
|
||||||
@ -1538,6 +1541,8 @@ void Session::configure(libtorrent::session_settings &sessionSettings)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sessionSettings.allow_multiple_connections_per_ip = multiConnectionsPerIpEnabled();
|
||||||
|
|
||||||
sessionSettings.apply_ip_filter_to_trackers = isTrackerFilteringEnabled();
|
sessionSettings.apply_ip_filter_to_trackers = isTrackerFilteringEnabled();
|
||||||
|
|
||||||
if (isDHTEnabled()) {
|
if (isDHTEnabled()) {
|
||||||
@ -3116,6 +3121,19 @@ void Session::setUtpMixedMode(int mode)
|
|||||||
configureDeferred();
|
configureDeferred();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Session::multiConnectionsPerIpEnabled() const
|
||||||
|
{
|
||||||
|
return m_multiConnectionsPerIpEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Session::setMultiConnectionsPerIpEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
if (enabled == m_multiConnectionsPerIpEnabled) return;
|
||||||
|
|
||||||
|
m_multiConnectionsPerIpEnabled = enabled;
|
||||||
|
configureDeferred();
|
||||||
|
}
|
||||||
|
|
||||||
bool Session::isTrackerFilteringEnabled() const
|
bool Session::isTrackerFilteringEnabled() const
|
||||||
{
|
{
|
||||||
return m_isTrackerFilteringEnabled;
|
return m_isTrackerFilteringEnabled;
|
||||||
|
@ -375,6 +375,8 @@ namespace BitTorrent
|
|||||||
void setUTPRateLimited(bool limited);
|
void setUTPRateLimited(bool limited);
|
||||||
int utpMixedMode() const;
|
int utpMixedMode() const;
|
||||||
void setUtpMixedMode(int mode);
|
void setUtpMixedMode(int mode);
|
||||||
|
bool multiConnectionsPerIpEnabled() const;
|
||||||
|
void setMultiConnectionsPerIpEnabled(bool enabled);
|
||||||
bool isTrackerFilteringEnabled() const;
|
bool isTrackerFilteringEnabled() const;
|
||||||
void setTrackerFilteringEnabled(bool enabled);
|
void setTrackerFilteringEnabled(bool enabled);
|
||||||
QStringList bannedIPs() const;
|
QStringList bannedIPs() const;
|
||||||
@ -600,6 +602,7 @@ namespace BitTorrent
|
|||||||
CachedSettingValue<bool> m_isUTPEnabled;
|
CachedSettingValue<bool> m_isUTPEnabled;
|
||||||
CachedSettingValue<bool> m_isUTPRateLimited;
|
CachedSettingValue<bool> m_isUTPRateLimited;
|
||||||
CachedSettingValue<int> m_utpMixedMode;
|
CachedSettingValue<int> m_utpMixedMode;
|
||||||
|
CachedSettingValue<bool> m_multiConnectionsPerIpEnabled;
|
||||||
CachedSettingValue<bool> m_isAddTrackersEnabled;
|
CachedSettingValue<bool> m_isAddTrackersEnabled;
|
||||||
CachedSettingValue<QString> m_additionalTrackers;
|
CachedSettingValue<QString> m_additionalTrackers;
|
||||||
CachedSettingValue<qreal> m_globalMaxRatio;
|
CachedSettingValue<qreal> m_globalMaxRatio;
|
||||||
|
@ -84,6 +84,7 @@ enum AdvSettingsRows
|
|||||||
OUTGOING_PORT_MIN,
|
OUTGOING_PORT_MIN,
|
||||||
OUTGOING_PORT_MAX,
|
OUTGOING_PORT_MAX,
|
||||||
UTP_MIX_MODE,
|
UTP_MIX_MODE,
|
||||||
|
MULTI_CONNECTIONS_PER_IP,
|
||||||
// embedded tracker
|
// embedded tracker
|
||||||
TRACKER_STATUS,
|
TRACKER_STATUS,
|
||||||
TRACKER_PORT,
|
TRACKER_PORT,
|
||||||
@ -138,6 +139,8 @@ void AdvancedSettings::saveAdvancedSettings()
|
|||||||
session->setOutgoingPortsMax(outgoing_ports_max.value());
|
session->setOutgoingPortsMax(outgoing_ports_max.value());
|
||||||
// uTP-TCP mixed mode
|
// uTP-TCP mixed mode
|
||||||
session->setUtpMixedMode(comboUtpMixedMode.currentIndex());
|
session->setUtpMixedMode(comboUtpMixedMode.currentIndex());
|
||||||
|
// multiple connections per IP
|
||||||
|
session->setMultiConnectionsPerIpEnabled(cbMultiConnectionsPerIp.isChecked());
|
||||||
// Recheck torrents on completion
|
// Recheck torrents on completion
|
||||||
pref->recheckTorrentsOnCompletion(cb_recheck_completed.isChecked());
|
pref->recheckTorrentsOnCompletion(cb_recheck_completed.isChecked());
|
||||||
// Transfer list refresh interval
|
// Transfer list refresh interval
|
||||||
@ -307,6 +310,9 @@ void AdvancedSettings::loadAdvancedSettings()
|
|||||||
comboUtpMixedMode.addItems({"Prefer TCP", "Peer proportional (throttles TCP)"});
|
comboUtpMixedMode.addItems({"Prefer TCP", "Peer proportional (throttles TCP)"});
|
||||||
comboUtpMixedMode.setCurrentIndex(session->utpMixedMode());
|
comboUtpMixedMode.setCurrentIndex(session->utpMixedMode());
|
||||||
addRow(UTP_MIX_MODE, tr("uTP-TCP mixed mode algorithm"), &comboUtpMixedMode);
|
addRow(UTP_MIX_MODE, tr("uTP-TCP mixed mode algorithm"), &comboUtpMixedMode);
|
||||||
|
// multiple connections per IP
|
||||||
|
cbMultiConnectionsPerIp.setChecked(session->multiConnectionsPerIpEnabled());
|
||||||
|
addRow(MULTI_CONNECTIONS_PER_IP, tr("Allow multiple connections from the same IP address"), &cbMultiConnectionsPerIp);
|
||||||
// Recheck completed torrents
|
// Recheck completed torrents
|
||||||
cb_recheck_completed.setChecked(pref->recheckTorrentsOnCompletion());
|
cb_recheck_completed.setChecked(pref->recheckTorrentsOnCompletion());
|
||||||
addRow(RECHECK_COMPLETED, tr("Recheck torrents on completion"), &cb_recheck_completed);
|
addRow(RECHECK_COMPLETED, tr("Recheck torrents on completion"), &cb_recheck_completed);
|
||||||
|
@ -78,7 +78,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;
|
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,
|
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_program_notifications, cb_torrent_added_notifications, cb_tracker_favicon, cb_tracker_status,
|
||||||
cb_confirm_torrent_recheck, cb_confirm_remove_all_tags, cb_listen_ipv6, cb_announce_all_trackers, cbGuidedReadCache;
|
cb_confirm_torrent_recheck, cb_confirm_remove_all_tags, cb_listen_ipv6, cb_announce_all_trackers, cbGuidedReadCache, cbMultiConnectionsPerIp;
|
||||||
QComboBox combo_iface, combo_iface_address, comboUtpMixedMode;
|
QComboBox combo_iface, combo_iface_address, comboUtpMixedMode;
|
||||||
QLineEdit txtAnnounceIP;
|
QLineEdit txtAnnounceIP;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user