mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-11 16:49:22 +00:00
* Don't show ETA on finished and stopped torrents.
* Added percentage completed to active unfinished torrents. * Re-enabled different seeding and leeching priorities. * Make a temporary container in AvailableList::insert(AddressList*) when doing std::set_differernce. AvailableList's std::vector would resize and cause invalidated iterators to be used. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@630 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+11
-6
@@ -97,14 +97,14 @@ Download::~Download() {
|
||||
|
||||
void
|
||||
Download::start() {
|
||||
if (is_done()) {
|
||||
if (is_done())
|
||||
m_download.set_connection_type(string_to_connection_type(m_variables.get("connection_seed").as_string()));
|
||||
torrent::download_set_priority(m_download, 2);
|
||||
} else {
|
||||
else
|
||||
m_download.set_connection_type(string_to_connection_type(m_variables.get("connection_leech").as_string()));
|
||||
torrent::download_set_priority(m_download, 4);
|
||||
}
|
||||
|
||||
// Update the priority to ensure it has the correct
|
||||
// seeding/unfinished modifiers.
|
||||
set_priority(priority());
|
||||
m_download.start();
|
||||
}
|
||||
|
||||
@@ -128,7 +128,12 @@ Download::set_priority(uint32_t p) {
|
||||
if (p >= 4)
|
||||
throw torrent::input_error("Priority out of range.");
|
||||
|
||||
torrent::download_set_priority(m_download, p * p);
|
||||
// Seeding torrents get half the priority of unfinished torrents.
|
||||
if (!is_done())
|
||||
torrent::download_set_priority(m_download, p * p * 2);
|
||||
else
|
||||
torrent::download_set_priority(m_download, p * p);
|
||||
|
||||
get_bencode().get_key("rtorrent").insert_key("priority", (int64_t)p);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user