From 1692fb6c03a51ae909b1dfe9690faa18ce8f02ba Mon Sep 17 00:00:00 2001
From: Doadin <tbkizle@gmail.com>
Date: Fri, 4 Jul 2014 00:00:28 -0400
Subject: [PATCH] Add Support for rate_limit_utp
New in libtorrent 0.16.x+
---
deluge/core/preferencesmanager.py | 5 +++++
deluge/ui/console/modes/preference_panes.py | 1 +
deluge/ui/gtkui/preferences.py | 3 +++
3 files changed, 9 insertions(+)
diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py
index 8eb3bea..064c202 100644
a
|
b
|
|
130 | 130 | "random_outgoing_ports": True, |
131 | 131 | "peer_tos": "0x00", |
132 | 132 | "rate_limit_ip_overhead": True, |
| 133 | "rate_limit_utp": True, |
133 | 134 | "geoip_db_location": "/usr/share/GeoIP/GeoIP.dat", |
134 | 135 | "cache_size": 512, |
135 | 136 | "cache_expiry": 60, |
… |
… |
def _on_set_rate_limit_ip_overhead(self, key, value):
|
443 | 444 | log.debug("%s: %s", key, value) |
444 | 445 | self.session_set_setting("rate_limit_ip_overhead", value) |
445 | 446 | |
| 447 | def _on_set_rate_limit_utp(self, key, value): |
| 448 | log.debug("%s: %s", key, value) |
| 449 | self.session_set_setting("rate_limit_utp", value) |
| 450 | |
446 | 451 | def _on_set_geoip_db_location(self, key, value): |
447 | 452 | log.debug("%s: %s", key, value) |
448 | 453 | # Load the GeoIP DB for country look-ups if available |
diff --git a/deluge/ui/console/modes/preference_panes.py b/deluge/ui/console/modes/preference_panes.py
index 3fb80ab..d8e3a89 100644
a
|
b
|
def __init__(self, offset, parent, width):
|
373 | 373 | self.add_int_spin_input("max_connections_per_second","Maximum Connection Attempts per Second:",parent.core_config["max_connections_per_second"],-1,9999) |
374 | 374 | self.add_checked_input("ignore_limits_on_local_network","Ignore limits on local network",parent.core_config["ignore_limits_on_local_network"]) |
375 | 375 | self.add_checked_input("rate_limit_ip_overhead","Rate Limit IP Overhead",parent.core_config["rate_limit_ip_overhead"]) |
| 376 | self.add_checked_input("rate_limit_utp","Rate Limit uTP",parent.core_config["rate_limit_utp"]) |
376 | 377 | self.add_header("Per Torrent Bandwidth Usage",True) |
377 | 378 | self.add_int_spin_input("max_connections_per_torrent","Maximum Connections:",parent.core_config["max_connections_per_torrent"],-1,9000) |
378 | 379 | self.add_int_spin_input("max_upload_slots_per_torrent","Maximum Upload Slots:",parent.core_config["max_upload_slots_per_torrent"],-1,9000) |
diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py
index 13da8ea..47b9fae 100644
a
|
b
|
def _show(self):
|
386 | 386 | "spin_max_connections_per_second": ("value", "max_connections_per_second"), |
387 | 387 | "chk_ignore_limits_on_local_network": ("active", "ignore_limits_on_local_network"), |
388 | 388 | "chk_rate_limit_ip_overhead": ("active", "rate_limit_ip_overhead"), |
| 389 | "chk_rate_limit_utp": ("active", "rate_limit_utp"), |
389 | 390 | "spin_max_connections_per_torrent": ("value", "max_connections_per_torrent"), |
390 | 391 | "spin_max_upload_slots_per_torrent": ("value", "max_upload_slots_per_torrent"), |
391 | 392 | "spin_max_download_per_torrent": ("value", "max_download_speed_per_torrent"), |
… |
… |
def set_config(self, hide=False):
|
646 | 647 | self.builder.get_object("chk_ignore_limits_on_local_network").get_active() |
647 | 648 | new_core_config["rate_limit_ip_overhead"] = \ |
648 | 649 | self.builder.get_object("chk_rate_limit_ip_overhead").get_active() |
| 650 | new_core_config["rate_limit_utp"] = \ |
| 651 | self.builder.get_object("chk_rate_limit_utp").get_active() |
649 | 652 | |
650 | 653 | ## Interface tab ## |
651 | 654 | new_gtkui_config["enable_system_tray"] = \ |