diff --git a/src/main.cc b/src/main.cc index 692c3d80..814daf74 100644 --- a/src/main.cc +++ b/src/main.cc @@ -136,7 +136,6 @@ initialize_option_handler(Control* c, OptionHandler* optionHandler) { optionHandler->insert("hash_max_tries", new OptionHandlerInt(c, &apply_hash_max_tries, &validate_hash_max_tries)); optionHandler->insert("max_open_files", new OptionHandlerInt(c, &apply_max_open_files, &validate_fd)); optionHandler->insert("max_open_sockets", new OptionHandlerInt(c, &apply_max_open_sockets, &validate_fd)); - optionHandler->insert("throttle_interval", new OptionHandlerInt(c, &apply_throttle_interval, &validate_throttle_interval)); optionHandler->insert("connection_leech", new OptionHandlerString(c, &apply_connection_leech, &validate_non_empty)); optionHandler->insert("connection_seed", new OptionHandlerString(c, &apply_connection_seed, &validate_non_empty)); diff --git a/src/option_handler_rules.cc b/src/option_handler_rules.cc index 721eb6d2..143cbe7a 100644 --- a/src/option_handler_rules.cc +++ b/src/option_handler_rules.cc @@ -111,11 +111,6 @@ validate_fd(int arg) { return arg >= 1 && arg < (1 << 16); } -bool -validate_throttle_interval(int arg) { - return arg > 0 && arg < 5000; -} - void apply_download_min_peers(Control* m, int arg) { m->core()->get_download_list().slot_map_insert()["1_min_peers"] = sigc::bind(sigc::mem_fun(&core::Download::call), arg); @@ -184,11 +179,6 @@ apply_max_open_sockets(Control* m, int arg) { torrent::set_max_open_sockets(arg); } -void -apply_throttle_interval(Control* m, int arg) { - torrent::set_throttle_interval(arg * 1000); -} - void apply_bind(Control* m, const std::string& arg) { torrent::set_bind_address(arg); diff --git a/src/option_handler_rules.h b/src/option_handler_rules.h index 2b9b48b4..bcdba935 100644 --- a/src/option_handler_rules.h +++ b/src/option_handler_rules.h @@ -61,8 +61,6 @@ bool validate_hash_interval(int arg); bool validate_hash_max_tries(int arg); bool validate_fd(int arg); -bool validate_throttle_interval(int arg); - void apply_download_min_peers(Control* m, int arg); void apply_download_max_peers(Control* m, int arg); void apply_download_max_uploads(Control* m, int arg); @@ -79,7 +77,6 @@ void apply_hash_interval(Control* m, int arg); void apply_hash_max_tries(Control* m, int arg); void apply_max_open_files(Control* m, int arg); void apply_max_open_sockets(Control* m, int arg); -void apply_throttle_interval(Control* m, int arg); void apply_ip(Control* m, const std::string& arg); void apply_bind(Control* m, const std::string& arg); diff --git a/src/ui/root.cc b/src/ui/root.cc index 9fd20bed..e437ceaa 100644 --- a/src/ui/root.cc +++ b/src/ui/root.cc @@ -116,7 +116,7 @@ void Root::receive_down_throttle(int t) { m_windowStatusbar->mark_dirty(); - torrent::set_down_throttle(torrent::get_down_throttle() + t * 1024); + torrent::set_down_throttle(std::max(torrent::get_down_throttle() + t * 1024, 0)); } void