From 077288407f9d110655e285fde04427d8549f9872 Mon Sep 17 00:00:00 2001 From: taylorchu Date: Tue, 10 Apr 2012 15:42:45 -0700 Subject: [PATCH 1/3] fix build after removing sigc++ for download.cc --- src/core/download.cc | 4 +--- src/core/download.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/core/download.cc b/src/core/download.cc index 3e704a49..c17e8e4f 100644 --- a/src/core/download.cc +++ b/src/core/download.cc @@ -36,9 +36,7 @@ #include "config.h" -#include -#include -#include +#include #include #include #include diff --git a/src/core/download.h b/src/core/download.h index 145e2915..4ac058bd 100644 --- a/src/core/download.h +++ b/src/core/download.h @@ -37,7 +37,6 @@ #ifndef RTORRENT_CORE_DOWNLOAD_H #define RTORRENT_CORE_DOWNLOAD_H -#include #include #include #include From 46862e23a962fdb8bc1cae464c743590e2ad2bd3 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Wed, 11 Apr 2012 19:24:24 +0900 Subject: [PATCH 2/3] Added ENODEV to "error_number.h". --- rak/error_number.h | 1 + 1 file changed, 1 insertion(+) diff --git a/rak/error_number.h b/rak/error_number.h index aa40deb9..2948a97e 100644 --- a/rak/error_number.h +++ b/rak/error_number.h @@ -51,6 +51,7 @@ public: static const int e_deadlk = EDEADLK; static const int e_noent = ENOENT; + static const int e_nodev = ENODEV; static const int e_nomem = ENOMEM; static const int e_notdir = ENOTDIR; static const int e_isdir = EISDIR; From d2dd143d2e3993d14c9278822813744a2a747cde Mon Sep 17 00:00:00 2001 From: rakshasa Date: Thu, 12 Apr 2012 15:29:07 +0900 Subject: [PATCH 3/3] Added 'throttle.update' to force 'throttle.max_{up,down}loads.global' setting to take effect. --- configure.ac | 2 +- src/command_throttle.cc | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b4a4d2d6..58b01f5a 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/src/command_throttle.cc b/src/command_throttle.cc index 0837a1ee..2f203d5f 100644 --- a/src/command_throttle.cc +++ b/src/command_throttle.cc @@ -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()));