mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-20 08:06:18 +00:00
Added throttle_interval option and backend.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@481 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -425,6 +425,16 @@
|
|||||||
</para></listitem>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>throttle_interval = <replaceable>ms</replaceable></term>
|
||||||
|
<listitem><para>
|
||||||
|
Interval between throttle ticks in milli-seconds, must be
|
||||||
|
between <emphasis>1-5000</emphasis> and defaults to
|
||||||
|
<emphasis>1000</emphasis>. Shorter intervals will cause less
|
||||||
|
bandwidth usage spikes while requiring more CPU resources.
|
||||||
|
</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>tracker_dump = <replaceable>yes | no</replaceable></term>
|
<term>tracker_dump = <replaceable>yes | no</replaceable></term>
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
|
|||||||
@@ -58,3 +58,7 @@
|
|||||||
|
|
||||||
# Dump data received from trackers to the files "./tracker_dump.<time>".
|
# Dump data received from trackers to the files "./tracker_dump.<time>".
|
||||||
#tracker_dump = no
|
#tracker_dump = no
|
||||||
|
|
||||||
|
# Change the interval between each throttle tick, in milliseconds. In
|
||||||
|
# the range 1-5000 ms.
|
||||||
|
#throttle_interval = 1000
|
||||||
|
|||||||
@@ -134,6 +134,8 @@ initialize_option_handler(ui::Control* c, OptionHandler* optionHandler) {
|
|||||||
|
|
||||||
optionHandler->insert("hash_read_ahead", new OptionHandlerInt(c, &apply_hash_read_ahead, &validate_read_ahead));
|
optionHandler->insert("hash_read_ahead", new OptionHandlerInt(c, &apply_hash_read_ahead, &validate_read_ahead));
|
||||||
optionHandler->insert("max_open_files", new OptionHandlerInt(c, &apply_max_open_files, &validate_fd));
|
optionHandler->insert("max_open_files", new OptionHandlerInt(c, &apply_max_open_files, &validate_fd));
|
||||||
|
optionHandler->insert("throttle_interval", new OptionHandlerInt(c, &apply_throttle_interval, &validate_throttle_interval));
|
||||||
|
|
||||||
optionHandler->insert("session", new OptionHandlerString(c, &apply_session_directory, &validate_directory));
|
optionHandler->insert("session", new OptionHandlerString(c, &apply_session_directory, &validate_directory));
|
||||||
optionHandler->insert("tracker_dump", new OptionHandlerString(c, &apply_tracker_dump, &validate_yes_no));
|
optionHandler->insert("tracker_dump", new OptionHandlerString(c, &apply_tracker_dump, &validate_yes_no));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,11 @@ validate_fd(int arg) {
|
|||||||
return arg >= 10 && arg < (1 << 16);
|
return arg >= 10 && arg < (1 << 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
validate_throttle_interval(int arg) {
|
||||||
|
return arg > 0 && arg < 5000;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
apply_download_min_peers(ui::Control* m, int arg) {
|
apply_download_min_peers(ui::Control* m, int arg) {
|
||||||
m->get_core().get_download_list().slot_map_insert().insert("1_min_peers", sigc::bind(sigc::mem_fun(&core::Download::call<void, uint32_t, &torrent::Download::set_peers_min>), arg));
|
m->get_core().get_download_list().slot_map_insert().insert("1_min_peers", sigc::bind(sigc::mem_fun(&core::Download::call<void, uint32_t, &torrent::Download::set_peers_min>), arg));
|
||||||
@@ -123,6 +128,11 @@ apply_max_open_files(ui::Control* m, int arg) {
|
|||||||
torrent::set_max_open_files(arg);
|
torrent::set_max_open_files(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
apply_throttle_interval(ui::Control* m, int arg) {
|
||||||
|
torrent::set_throttle_interval(arg * 1000);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
apply_bind(ui::Control* m, const std::string& arg) {
|
apply_bind(ui::Control* m, const std::string& arg) {
|
||||||
torrent::set_bind(arg);
|
torrent::set_bind(arg);
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ bool validate_rate(int arg);
|
|||||||
bool validate_read_ahead(int arg);
|
bool validate_read_ahead(int arg);
|
||||||
bool validate_fd(int arg);
|
bool validate_fd(int arg);
|
||||||
|
|
||||||
|
bool validate_throttle_interval(int arg);
|
||||||
|
|
||||||
void apply_download_min_peers(ui::Control* m, int arg);
|
void apply_download_min_peers(ui::Control* m, int arg);
|
||||||
void apply_download_max_peers(ui::Control* m, int arg);
|
void apply_download_max_peers(ui::Control* m, int arg);
|
||||||
void apply_download_max_uploads(ui::Control* m, int arg);
|
void apply_download_max_uploads(ui::Control* m, int arg);
|
||||||
@@ -55,6 +57,7 @@ void apply_global_upload_rate(ui::Control* m, int arg);
|
|||||||
|
|
||||||
void apply_hash_read_ahead(ui::Control* m, int arg);
|
void apply_hash_read_ahead(ui::Control* m, int arg);
|
||||||
void apply_max_open_files(ui::Control* m, int arg);
|
void apply_max_open_files(ui::Control* m, int arg);
|
||||||
|
void apply_throttle_interval(ui::Control* m, int arg);
|
||||||
|
|
||||||
void apply_ip(ui::Control* m, const std::string& arg);
|
void apply_ip(ui::Control* m, const std::string& arg);
|
||||||
void apply_bind(ui::Control* m, const std::string& arg);
|
void apply_bind(ui::Control* m, const std::string& arg);
|
||||||
|
|||||||
Reference in New Issue
Block a user