* 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:
rakshasa
2006-02-04 19:18:41 +00:00
parent d06ecda46a
commit 68502367ec
17 changed files with 184 additions and 91 deletions
+11 -6
View File
@@ -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);
}