Ticket #2471: [#2471][GTKUI]rate_limit_utp.patch

File [#2471][GTKUI]rate_limit_utp.patch, 3.8 KB (added by Doadin, 10 years ago)
  • deluge/core/preferencesmanager.py

    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  
    130130    "random_outgoing_ports": True, 
    131131    "peer_tos": "0x00", 
    132132    "rate_limit_ip_overhead": True, 
     133    "rate_limit_utp": True, 
    133134    "geoip_db_location": "/usr/share/GeoIP/GeoIP.dat", 
    134135    "cache_size": 512, 
    135136    "cache_expiry": 60, 
    def _on_set_rate_limit_ip_overhead(self, key, value): 
    443444        log.debug("%s: %s", key, value) 
    444445        self.session_set_setting("rate_limit_ip_overhead", value) 
    445446 
     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 
    446451    def _on_set_geoip_db_location(self, key, value): 
    447452        log.debug("%s: %s", key, value) 
    448453        # Load the GeoIP DB for country look-ups if available 
  • deluge/ui/console/modes/preference_panes.py

    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): 
    373373        self.add_int_spin_input("max_connections_per_second","Maximum Connection Attempts per Second:",parent.core_config["max_connections_per_second"],-1,9999) 
    374374        self.add_checked_input("ignore_limits_on_local_network","Ignore limits on local network",parent.core_config["ignore_limits_on_local_network"]) 
    375375        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"]) 
    376377        self.add_header("Per Torrent Bandwidth Usage",True) 
    377378        self.add_int_spin_input("max_connections_per_torrent","Maximum Connections:",parent.core_config["max_connections_per_torrent"],-1,9000) 
    378379        self.add_int_spin_input("max_upload_slots_per_torrent","Maximum Upload Slots:",parent.core_config["max_upload_slots_per_torrent"],-1,9000) 
  • deluge/ui/gtkui/preferences.py

    diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py
    index 13da8ea..47b9fae 100644
    a b def _show(self): 
    386386            "spin_max_connections_per_second": ("value", "max_connections_per_second"), 
    387387            "chk_ignore_limits_on_local_network": ("active", "ignore_limits_on_local_network"), 
    388388            "chk_rate_limit_ip_overhead": ("active", "rate_limit_ip_overhead"), 
     389            "chk_rate_limit_utp": ("active", "rate_limit_utp"), 
    389390            "spin_max_connections_per_torrent": ("value", "max_connections_per_torrent"), 
    390391            "spin_max_upload_slots_per_torrent": ("value", "max_upload_slots_per_torrent"), 
    391392            "spin_max_download_per_torrent": ("value", "max_download_speed_per_torrent"), 
    def set_config(self, hide=False): 
    646647            self.builder.get_object("chk_ignore_limits_on_local_network").get_active() 
    647648        new_core_config["rate_limit_ip_overhead"] = \ 
    648649            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() 
    649652 
    650653        ## Interface tab ## 
    651654        new_gtkui_config["enable_system_tray"] = \