* Added resume functions for saving/loading tracker state.

* Added parameter to torrent::resume_save_progress to indicate that
only completed files are to be saved. This is used when the torrent is
active.

* Update the display when priority is changed.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@746 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-07-22 20:41:47 +00:00
parent 652fd25c07
commit ef90f0f51e
5 changed files with 14 additions and 9 deletions
+1
View File
@@ -193,6 +193,7 @@ DownloadFactory::receive_success() {
torrent::resume_load_addresses(*download->download(), resumeObject);
torrent::resume_load_file_priorities(*download->download(), resumeObject);
torrent::resume_load_tracker_settings(*download->download(), resumeObject);
// The action of inserting might cause the torrent to be
// opened/started or such. Figure out a nicer way of handling this.
+1 -1
View File
@@ -321,7 +321,7 @@ DownloadList::resume(Download* download) {
// on non-complete downloads after a crash. This shouldn't be
// needed, but for some reason linux 2.6 is very lazy about
// updating mtime.
torrent::resume_clear_progress(*download->download(), download->download()->bencode()->get_key("libtorrent_resume"));
torrent::resume_save_progress(*download->download(), download->download()->bencode()->get_key("libtorrent_resume"), true);
}
// Update the priority to ensure it has the correct
+5 -2
View File
@@ -109,8 +109,11 @@ DownloadStore::save(Download* d) {
d->bencode()->get_key("rtorrent").insert_key("total_uploaded", d->download()->up_rate()->total());
d->bencode()->get_key("rtorrent").insert_key("chunks_done", d->download()->chunks_done());
torrent::resume_save_addresses(*d->download(), d->download()->bencode()->get_key("libtorrent_resume"));
torrent::resume_save_file_priorities(*d->download(), d->download()->bencode()->get_key("libtorrent_resume"));
torrent::Object& resumeObject = d->download()->bencode()->get_key("libtorrent_resume");
torrent::resume_save_addresses(*d->download(), resumeObject);
torrent::resume_save_file_priorities(*d->download(), resumeObject);
torrent::resume_save_tracker_settings(*d->download(), resumeObject);
f << *d->bencode();