From 3dbd3a3fd3a58a022a8675cbcdce89fe7f47cfae Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sat, 22 Nov 2008 09:00:01 +0000 Subject: [PATCH] Add an option to not include IP overhead in rate limiting (setting False is equivalent to how 0.5.x behaves) --- deluge/core/preferencesmanager.py | 8 + .../ui/gtkui/glade/preferences_dialog.glade | 1410 +++++++++-------- deluge/ui/gtkui/preferences.py | 5 + .../bindings/python/src/session_settings.cpp | 11 +- 4 files changed, 733 insertions(+), 701 deletions(-) diff --git a/deluge/core/preferencesmanager.py b/deluge/core/preferencesmanager.py index acf14e0fe..dd7750f9c 100644 --- a/deluge/core/preferencesmanager.py +++ b/deluge/core/preferencesmanager.py @@ -107,6 +107,7 @@ DEFAULT_PREFS = { "outgoing_ports": [0, 0], "random_outgoing_ports": True, "peer_tos": "0x00", + "rate_limit_ip_overhead": True } class PreferencesManager(component.Component): @@ -192,6 +193,8 @@ class PreferencesManager(component.Component): self.new_release_timer = None self.config.register_set_function("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) @@ -454,3 +457,8 @@ class PreferencesManager(component.Component): self.session.set_web_seed_proxy(proxy_settings) self.session.set_tracker_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) diff --git a/deluge/ui/gtkui/glade/preferences_dialog.glade b/deluge/ui/gtkui/glade/preferences_dialog.glade index 47ad518a4..2706d8c8d 100644 --- a/deluge/ui/gtkui/glade/preferences_dialog.glade +++ b/deluge/ui/gtkui/glade/preferences_dialog.glade @@ -1,6 +1,6 @@ - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -105,25 +105,108 @@ 4 2 - + + True + 0 + Download to: + + + GTK_FILL + + + + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 - + True + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + Select A Folder + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + + + + + 1 + 2 + + + + + True + True + Move completed to: + 0 + True + + + + 1 + 2 + GTK_FILL + + + + + True + True + Copy of .torrent files to: + 0 + True + + + + 2 + 3 + GTK_FILL + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Auto add .torrents from: + 0 + True + + + + 3 + 4 + GTK_FILL + + + + + True + + + True 5 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER + Select A Folder - + True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 1 @@ -135,8 +218,8 @@ 1 2 - 3 - 4 + 1 + 2 @@ -176,23 +259,25 @@ - + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER - Select A Folder - + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 1 @@ -204,93 +289,8 @@ 1 2 - 1 - 2 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Auto add .torrents from: - 0 - True - - - 3 4 - GTK_FILL - - - - - True - True - Copy of .torrent files to: - 0 - True - - - - 2 - 3 - GTK_FILL - - - - - True - True - Move completed to: - 0 - True - - - - 1 - 2 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER - Select A Folder - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - 1 - 2 - - - - - True - 0 - Download to: - - - GTK_FILL @@ -874,34 +874,36 @@ - + True True - Universal Plug and Play - UPnP + Distributed hash table may improve the amount of active connections. + DHT True 0 - True - True - - - GTK_FILL - - - - - True - True - NAT Port Mapping Protocol - NAT-PMP - True - 0 - True True 1 2 + 1 + 2 + GTK_FILL + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Local Service Discovery finds local peers on your network. + LSD + 0 + True + + + 1 + 2 GTK_FILL @@ -923,36 +925,34 @@ - + True True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Local Service Discovery finds local peers on your network. - LSD - 0 - True - - - 1 - 2 - GTK_FILL - - - - - True - True - Distributed hash table may improve the amount of active connections. - DHT + NAT Port Mapping Protocol + NAT-PMP True 0 + True True 1 2 - 1 - 2 + GTK_FILL + + + + + True + True + Universal Plug and Play + UPnP + True + 0 + True + True + + GTK_FILL @@ -1215,127 +1215,40 @@ Disabled 2 15 - + True True + The maximum upload slots for all torrents. Set -1 for unlimited. 1 - -1 -1 9999 1 10 10 + -1 -1 9000 1 10 10 + 1 + True True 1 2 - 5 - 6 - GTK_FILL - - - - - True - True - 1 - -1 -1 9999 1 10 10 - True - - - 1 - 2 - 4 - 5 - GTK_FILL - - - - - True - 0 - Maximum Connection Attempts per Second: - - - 5 - 6 - GTK_FILL - - - - - True - 0 - Maximum Half-Open Connections: - - - 4 - 5 - GTK_FILL - - - - - True - The maximum upload speed for all torrents. Set -1 for unlimited. - 0 - Maximum Upload Speed (KiB/s): - - - 3 - 4 - GTK_FILL - - - - - True - The maximum number of connections allowed. Set -1 for unlimited. - 0 - Maximum Connections: - - - GTK_FILL - - - - - True - The maximum upload speed for all torrents. Set -1 for unlimited. - 0 - Maximum Upload Slots: - - 1 2 GTK_FILL - + True True - The maximum number of connections allowed. Set -1 for unlimited. - 4 + The maximum upload speed for all torrents. Set -1 for unlimited. 1 -1 -1 9000 1 10 10 1 - True + 1 True - GTK_UPDATE_IF_VALID 1 2 - GTK_FILL - - - - - True - The maximum download speed for all torrents. Set -1 for unlimited. - 0 - Maximum Download Speed (KiB/s): - - - 2 - 3 + 3 + 4 GTK_FILL @@ -1360,40 +1273,127 @@ Disabled - + + True + The maximum download speed for all torrents. Set -1 for unlimited. + 0 + Maximum Download Speed (KiB/s): + + + 2 + 3 + GTK_FILL + + + + True True - The maximum upload speed for all torrents. Set -1 for unlimited. + The maximum number of connections allowed. Set -1 for unlimited. + 4 1 -1 -1 9000 1 10 10 1 - 1 + True True + GTK_UPDATE_IF_VALID 1 2 + GTK_FILL + + + + + True + The maximum upload speed for all torrents. Set -1 for unlimited. + 0 + Maximum Upload Slots: + + + 1 + 2 + GTK_FILL + + + + + True + The maximum number of connections allowed. Set -1 for unlimited. + 0 + Maximum Connections: + + + GTK_FILL + + + + + True + The maximum upload speed for all torrents. Set -1 for unlimited. + 0 + Maximum Upload Speed (KiB/s): + + 3 4 GTK_FILL - + + True + 0 + Maximum Half-Open Connections: + + + 4 + 5 + GTK_FILL + + + + + True + 0 + Maximum Connection Attempts per Second: + + + 5 + 6 + GTK_FILL + + + + True True - The maximum upload slots for all torrents. Set -1 for unlimited. 1 - -1 -1 9000 1 10 10 - 1 - True + -1 -1 9999 1 10 10 True 1 2 - 1 - 2 + 4 + 5 + GTK_FILL + + + + + True + True + 1 + -1 -1 9999 1 10 10 + True + + + 1 + 2 + 5 + 6 GTK_FILL @@ -1418,6 +1418,26 @@ Disabled 1 + + + True + 5 + + + True + True + If checked, the estimated TCP/IP overhead is drained from the rate limiters, to avoid exceeding the limits with the total traffic + Rate limit IP overhead + 0 + True + True + + + + + 2 + + @@ -1461,85 +1481,18 @@ Disabled 2 15 - - True - True - The maximum upload slots per torrent. Set -1 for unlimited. - 1 - -1 -1 9000 1 10 10 - 1 - True - True - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - + True True The maximum number of connections per torrent. Set -1 for unlimited. 1 -1 -1 9000 1 10 10 - True + 1 True 1 2 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Maximum Connections: - - - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Maximum Upload Slots: - - - 1 - 2 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Maximum Download Speed (KiB/s): - - - 2 - 3 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Maximum Upload Speed (KiB/s): - - 3 4 GTK_FILL @@ -1564,20 +1517,87 @@ Disabled - + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Maximum Upload Speed (KiB/s): + + + 3 + 4 + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Maximum Download Speed (KiB/s): + + + 2 + 3 + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Maximum Upload Slots: + + + 1 + 2 + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Maximum Connections: + + + GTK_FILL + + + + True True The maximum number of connections per torrent. Set -1 for unlimited. 1 -1 -1 9000 1 10 10 - 1 + True True 1 2 - 3 - 4 + GTK_FILL + + + + + True + True + The maximum upload slots per torrent. Set -1 for unlimited. + 1 + -1 -1 9000 1 10 10 + 1 + True + True + + + 1 + 2 + 1 + 2 GTK_FILL @@ -2477,59 +2497,15 @@ Disabled 2 10 - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 - 0 -1 9999 1 10 10 - True - True - - - 1 - 2 - - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 - 0 -1 9999 1 10 10 - True - True - - - 1 - 2 - 2 - 3 - - - - - - True - 0 - Total active seeding: - - - 2 - 3 - GTK_FILL - - - - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - Total active: + Total active downloading: + 1 + 2 GTK_FILL @@ -2552,18 +2528,62 @@ Disabled - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 0 - Total active downloading: + Total active: - 1 - 2 GTK_FILL + + + True + 0 + Total active seeding: + + + 2 + 3 + GTK_FILL + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 1 + 0 -1 9999 1 10 10 + True + True + + + 1 + 2 + 2 + 3 + + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 1 + 0 -1 9999 1 10 10 + True + True + + + 1 + 2 + + + @@ -2624,51 +2644,18 @@ Disabled 2 10 - - True - 0 - Share Ratio Limit: - - - GTK_FILL - - - - - True - 0 - Seed Time Ratio: - - - 1 - 2 - GTK_FILL - - - - - True - 0 - Seed Time (m): - - - 2 - 3 - GTK_FILL - - - - + True True 6 1 - 1.5 -1 100 0.10000000000000001 10 10 - 2 + 6 -1 100 1 10 10 1 2 + 2 + 3 @@ -2690,19 +2677,52 @@ Disabled - + True True 6 1 - 6 -1 100 1 10 10 + 1.5 -1 100 0.10000000000000001 10 10 + 2 1 2 + + + + + + True + 0 + Seed Time (m): + + 2 3 - + GTK_FILL + + + + + True + 0 + Seed Time Ratio: + + + 1 + 2 + GTK_FILL + + + + + True + 0 + Share Ratio Limit: + + + GTK_FILL @@ -2877,43 +2897,86 @@ Disabled 2 5 - + True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + 0 + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 0 65000 1 10 10 + True + + 1 2 + 4 + 5 + + + + + True + 0 + Port: + + + 4 + 5 + GTK_FILL + + + + + True + 0 + Host: + + 3 4 + GTK_FILL - + True - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False + 0 + Password: - 1 - 2 2 3 + GTK_FILL - + True - True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Username: - 1 - 2 1 2 + GTK_FILL + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Type: + + + GTK_FILL @@ -2934,86 +2997,43 @@ HTTP W/ Auth - + True + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Type: - - - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Username: - - - 1 - 2 - GTK_FILL - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Password: - - - 2 - 3 - GTK_FILL - - - - - True - 0 - Host: - - - 3 - 4 - GTK_FILL - - - - - True - 0 - Port: - - - 4 - 5 - GTK_FILL - - - - - True - 0 - 0 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 0 65000 1 10 10 - True - - 1 2 - 4 - 5 + 1 + 2 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + + + 1 + 2 + 2 + 3 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + 2 + 3 + 4 @@ -3114,18 +3134,27 @@ HTTP W/ Auth 2 5 - + + True + + + 1 + 2 + 2 + 3 + + + + True True - Only OGG and WAV files are supported - Sound: + Blinking tray icon True 0 True - 2 - 3 + 2 GTK_FILL @@ -3146,28 +3175,19 @@ HTTP W/ Auth - + True True - Blinking tray icon + Only OGG and WAV files are supported + Sound: True 0 True - 2 - GTK_FILL - - - - - True - - - 1 - 2 2 3 + GTK_FILL @@ -3208,14 +3228,115 @@ HTTP W/ Auth 2 5 - + True - 0 - Security: + True + Enable + 0 + True - 5 - 6 + 2 + GTK_FILL + GTK_FILL + + + + + True + True + + + 1 + 2 + 1 + 2 + + + + + True + 0 + Address: + + + 1 + 2 + GTK_FILL + GTK_FILL + + + + + True + True + + + 1 + 2 + 2 + 3 + + + + + True + 0 + Server: + + + 2 + 3 + GTK_FILL + GTK_FILL + + + + + True + True + + + 1 + 2 + 3 + 4 + + + + + True + 0 + Username: + + + 3 + 4 + GTK_FILL + + + + + True + True + False + + + 1 + 2 + 4 + 5 + + + + + True + 0 + Password: + + + 4 + 5 GTK_FILL @@ -3278,118 +3399,17 @@ HTTP W/ Auth - + True 0 - Password: + Security: - 4 - 5 + 5 + 6 GTK_FILL - - - True - True - False - - - 1 - 2 - 4 - 5 - - - - - True - 0 - Username: - - - 3 - 4 - GTK_FILL - - - - - True - True - - - 1 - 2 - 3 - 4 - - - - - True - 0 - Server: - - - 2 - 3 - GTK_FILL - GTK_FILL - - - - - True - True - - - 1 - 2 - 2 - 3 - - - - - True - 0 - Address: - - - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - True - - - 1 - 2 - 1 - 2 - - - - - True - True - Enable - 0 - True - - - 2 - GTK_FILL - GTK_FILL - - @@ -3521,78 +3541,39 @@ HTTP W/ Auth 2 5 - + True 0 1 2 - 2 - 3 + 4 + 5 - + True 0 1 2 - 3 - 4 - - - - - - True - 0 - Author Email: - - - 2 - 3 - GTK_FILL - GTK_FILL - - - - - True - 0 - Homepage: - - - 3 - 4 - GTK_FILL - GTK_FILL - - - - - True - 0 - Author: - - - GTK_FILL - - - - - - True - 0 - Version: - - 1 2 - GTK_FILL + + + + + + True + 0 + + + 1 + 2 @@ -3611,39 +3592,78 @@ HTTP W/ Auth - + True 0 + Version: - 1 - 2 - - - - - - True - 0 - - - 1 - 2 1 2 + GTK_FILL - + + True + 0 + Author: + + + GTK_FILL + + + + + + True + 0 + Homepage: + + + 3 + 4 + GTK_FILL + GTK_FILL + + + + + True + 0 + Author Email: + + + 2 + 3 + GTK_FILL + GTK_FILL + + + + True 0 1 2 - 4 - 5 + 3 + 4 + + + + + + True + 0 + + + 1 + 2 + 2 + 3 diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index b9c495c03..d7b6b34d0 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -246,6 +246,8 @@ class Preferences(component.Component): ("value", self.core_config["max_connections_per_second"]), "chk_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": \ ("value", self.core_config["max_connections_per_torrent"]), "spin_max_upload_slots_per_torrent": \ @@ -375,6 +377,7 @@ class Preferences(component.Component): "spin_max_half_open_connections", "spin_max_connections_per_second", "chk_ignore_limits_on_local_network", + "chk_rate_limit_ip_overhead", "spin_max_connections_per_torrent", "spin_max_upload_slots_per_torrent", "spin_max_download_per_torrent", @@ -589,6 +592,8 @@ class Preferences(component.Component): "spin_max_download_per_torrent").get_value() new_core_config["ignore_limits_on_local_network"] = \ 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 ## new_gtkui_config["enable_system_tray"] = \ diff --git a/libtorrent/bindings/python/src/session_settings.cpp b/libtorrent/bindings/python/src/session_settings.cpp index 3f2a7b632..76e078560 100755 --- a/libtorrent/bindings/python/src/session_settings.cpp +++ b/libtorrent/bindings/python/src/session_settings.cpp @@ -44,11 +44,12 @@ void bind_session_settings() .def_readwrite("seed_time_limit", &session_settings::seed_time_limit) .def_readwrite("auto_scraped_interval", &session_settings::auto_scrape_interval) .def_readwrite("peer_tos", &session_settings::peer_tos) + .def_readwrite("rate_limit_ip_overhead", &session_settings::rate_limit_ip_overhead) #ifndef TORRENT_DISABLE_DHT .def_readwrite("use_dht_as_fallback", &session_settings::use_dht_as_fallback) #endif ; - + enum_("proxy_type") .value("none", proxy_settings::none) .value("socks4", proxy_settings::socks4) @@ -57,7 +58,7 @@ void bind_session_settings() .value("http", proxy_settings::http) .value("http_pw", proxy_settings::http_pw) ; - class_("proxy_settings") + class_("proxy_settings") .def_readwrite("hostname", &proxy_settings::hostname) .def_readwrite("port", &proxy_settings::port) .def_readwrite("password", &proxy_settings::password) @@ -71,11 +72,11 @@ void bind_session_settings() .value("enabled", pe_settings::enabled) .value("disabled", pe_settings::disabled) ; - + enum_("enc_level") .value("rc4", pe_settings::rc4) .value("plaintext", pe_settings::plaintext) - .value("both", pe_settings::both) + .value("both", pe_settings::both) ; class_("pe_settings") @@ -87,5 +88,3 @@ void bind_session_settings() #endif } - -