mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +00:00
Add an option to not include IP overhead in rate limiting (setting False
is equivalent to how 0.5.x behaves)
This commit is contained in:
parent
4bfd5646ad
commit
3dbd3a3fd3
4 changed files with 733 additions and 701 deletions
|
@ -107,6 +107,7 @@ DEFAULT_PREFS = {
|
||||||
"outgoing_ports": [0, 0],
|
"outgoing_ports": [0, 0],
|
||||||
"random_outgoing_ports": True,
|
"random_outgoing_ports": True,
|
||||||
"peer_tos": "0x00",
|
"peer_tos": "0x00",
|
||||||
|
"rate_limit_ip_overhead": True
|
||||||
}
|
}
|
||||||
|
|
||||||
class PreferencesManager(component.Component):
|
class PreferencesManager(component.Component):
|
||||||
|
@ -192,6 +193,8 @@ class PreferencesManager(component.Component):
|
||||||
self.new_release_timer = None
|
self.new_release_timer = None
|
||||||
self.config.register_set_function("new_release_check",
|
self.config.register_set_function("new_release_check",
|
||||||
self._on_new_release_check)
|
self._on_new_release_check)
|
||||||
|
self.config.register_set_function("rate_limit_ip_overhead",
|
||||||
|
self._on_rate_limit_ip_overhead)
|
||||||
|
|
||||||
self.config.register_change_callback(self._on_config_value_change)
|
self.config.register_change_callback(self._on_config_value_change)
|
||||||
|
|
||||||
|
@ -454,3 +457,8 @@ class PreferencesManager(component.Component):
|
||||||
self.session.set_web_seed_proxy(proxy_settings)
|
self.session.set_web_seed_proxy(proxy_settings)
|
||||||
self.session.set_tracker_proxy(proxy_settings)
|
self.session.set_tracker_proxy(proxy_settings)
|
||||||
self.session.set_dht_proxy(proxy_settings)
|
self.session.set_dht_proxy(proxy_settings)
|
||||||
|
|
||||||
|
def _on_rate_limit_ip_overhead(self, key, value):
|
||||||
|
log.debug("%s: %s", key, value)
|
||||||
|
self.settings.rate_limit_ip_overhead = value
|
||||||
|
self.session.set_settings(self.settings)
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -246,6 +246,8 @@ class Preferences(component.Component):
|
||||||
("value", self.core_config["max_connections_per_second"]),
|
("value", self.core_config["max_connections_per_second"]),
|
||||||
"chk_ignore_limits_on_local_network": \
|
"chk_ignore_limits_on_local_network": \
|
||||||
("active", self.core_config["ignore_limits_on_local_network"]),
|
("active", self.core_config["ignore_limits_on_local_network"]),
|
||||||
|
"chk_rate_limit_ip_overhead": \
|
||||||
|
("active", self.core_config["rate_limit_ip_overhead"]),
|
||||||
"spin_max_connections_per_torrent": \
|
"spin_max_connections_per_torrent": \
|
||||||
("value", self.core_config["max_connections_per_torrent"]),
|
("value", self.core_config["max_connections_per_torrent"]),
|
||||||
"spin_max_upload_slots_per_torrent": \
|
"spin_max_upload_slots_per_torrent": \
|
||||||
|
@ -375,6 +377,7 @@ class Preferences(component.Component):
|
||||||
"spin_max_half_open_connections",
|
"spin_max_half_open_connections",
|
||||||
"spin_max_connections_per_second",
|
"spin_max_connections_per_second",
|
||||||
"chk_ignore_limits_on_local_network",
|
"chk_ignore_limits_on_local_network",
|
||||||
|
"chk_rate_limit_ip_overhead",
|
||||||
"spin_max_connections_per_torrent",
|
"spin_max_connections_per_torrent",
|
||||||
"spin_max_upload_slots_per_torrent",
|
"spin_max_upload_slots_per_torrent",
|
||||||
"spin_max_download_per_torrent",
|
"spin_max_download_per_torrent",
|
||||||
|
@ -589,6 +592,8 @@ class Preferences(component.Component):
|
||||||
"spin_max_download_per_torrent").get_value()
|
"spin_max_download_per_torrent").get_value()
|
||||||
new_core_config["ignore_limits_on_local_network"] = \
|
new_core_config["ignore_limits_on_local_network"] = \
|
||||||
self.glade.get_widget("chk_ignore_limits_on_local_network").get_active()
|
self.glade.get_widget("chk_ignore_limits_on_local_network").get_active()
|
||||||
|
new_core_config["rate_limit_ip_overhead"] = \
|
||||||
|
self.glade.get_widget("chk_rate_limit_ip_overhead").get_active()
|
||||||
|
|
||||||
## Interface tab ##
|
## Interface tab ##
|
||||||
new_gtkui_config["enable_system_tray"] = \
|
new_gtkui_config["enable_system_tray"] = \
|
||||||
|
|
|
@ -44,6 +44,7 @@ void bind_session_settings()
|
||||||
.def_readwrite("seed_time_limit", &session_settings::seed_time_limit)
|
.def_readwrite("seed_time_limit", &session_settings::seed_time_limit)
|
||||||
.def_readwrite("auto_scraped_interval", &session_settings::auto_scrape_interval)
|
.def_readwrite("auto_scraped_interval", &session_settings::auto_scrape_interval)
|
||||||
.def_readwrite("peer_tos", &session_settings::peer_tos)
|
.def_readwrite("peer_tos", &session_settings::peer_tos)
|
||||||
|
.def_readwrite("rate_limit_ip_overhead", &session_settings::rate_limit_ip_overhead)
|
||||||
#ifndef TORRENT_DISABLE_DHT
|
#ifndef TORRENT_DISABLE_DHT
|
||||||
.def_readwrite("use_dht_as_fallback", &session_settings::use_dht_as_fallback)
|
.def_readwrite("use_dht_as_fallback", &session_settings::use_dht_as_fallback)
|
||||||
#endif
|
#endif
|
||||||
|
@ -87,5 +88,3 @@ void bind_session_settings()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue