Added 'throttle.update' to force 'throttle.max_{up,down}loads.global' setting to take effect.

This commit is contained in:
rakshasa
2012-04-12 15:29:07 +09:00
parent b71b44dbd6
commit d2dd143d2e
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
AC_INIT(rtorrent, 0.9.1, jaris@ifi.uio.no)
AC_DEFINE(API_VERSION, 4, api version)
AC_DEFINE(API_VERSION, 5, api version)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
+9
View File
@@ -162,6 +162,13 @@ apply_address_throttle(const torrent::Object::list_type& args) {
return torrent::Object();
}
torrent::Object
throttle_update() {
control->ui()->adjust_up_throttle(0);
control->ui()->adjust_down_throttle(0);
return torrent::Object();
}
void
initialize_command_throttle() {
CMD2_ANY ("throttle.unchoked_uploads", tr1::bind(&torrent::ResourceManager::currently_upload_unchoked, torrent::resource_manager()));
@@ -182,6 +189,8 @@ initialize_command_throttle() {
CMD2_VAR_VALUE ("throttle.max_downloads.div", 1);
CMD2_VAR_VALUE ("throttle.max_downloads.global", 0);
CMD2_ANY ("throttle.update", tr1::bind(&throttle_update));
// TODO: Move the logic into some libtorrent function.
CMD2_ANY ("throttle.global_up.rate", tr1::bind(&torrent::Rate::rate, torrent::up_rate()));
CMD2_ANY ("throttle.global_up.total", tr1::bind(&torrent::Rate::total, torrent::up_rate()));