mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-08 03:02:30 +00:00
* Added "max_uploads_div" option to set fewer global upload
slots. Currently just intended for testing purposes. * Renamed and changed the use of ProtocolBase variables within ChokeManager. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@864 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -486,6 +486,7 @@ initialize_variables() {
|
||||
variables->insert("min_peers_seed", new utils::VariableValue(-1));
|
||||
variables->insert("max_peers_seed", new utils::VariableValue(-1));
|
||||
variables->insert("max_uploads", new utils::VariableValue(15));
|
||||
variables->insert("max_uploads_div", new utils::VariableValue(1));
|
||||
variables->insert("max_chunks_queued", new utils::VariableValue(0));
|
||||
|
||||
variables->insert("download_rate", new utils::VariableValueSlot(rak::ptr_fn(&torrent::down_throttle), rak::mem_fn(control->ui(), &ui::Root::set_down_throttle_i64),
|
||||
|
||||
+6
-3
@@ -171,12 +171,15 @@ Root::set_up_throttle(unsigned int throttle) {
|
||||
|
||||
torrent::set_up_throttle(throttle * 1024);
|
||||
|
||||
if (throttle == 0)
|
||||
if (throttle == 0) {
|
||||
torrent::set_max_unchoked(0);
|
||||
return;
|
||||
}
|
||||
|
||||
else if (throttle <= 10)
|
||||
throttle /= control->variable()->get_value("max_uploads_div");
|
||||
|
||||
if (throttle <= 10)
|
||||
torrent::set_max_unchoked(1 + throttle / 1);
|
||||
|
||||
else
|
||||
torrent::set_max_unchoked(10 + throttle / 5);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user