* Properly invalidate BlockTransfer's in Block so they get deleted.

* Added is_active flag to TrackerManager and don't reset the
up/download baseline in Download::start() when a request is queued.

* Remove the "started" filter in hashing view, so it starts hashing
stopped torrents.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@735 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-07-03 00:18:48 +00:00
parent 26ffe74744
commit c957d1b4d1
2 changed files with 11 additions and 5 deletions
+10 -4
View File
@@ -328,7 +328,12 @@ DownloadList::pause(Download* download) {
// Always clear hashing on pause. When a hashing request is added,
// it should have cleared the hash resume data.
download->variable()->set_value("hashing", Download::variable_hashing_stopped);
if (download->variable()->get_value("hashing") != Download::variable_hashing_stopped) {
download->download()->hash_stop();
download->variable()->set_value("hashing", Download::variable_hashing_stopped);
std::for_each(slot_map_hash_removed().begin(), slot_map_hash_removed().end(), download_list_call(download));
}
if (!download->download()->is_active())
return;
@@ -337,7 +342,6 @@ DownloadList::pause(Download* download) {
torrent::resume_save_progress(*download->download(), download->download()->bencode()->get_key("libtorrent_resume"));
std::for_each(slot_map_stop().begin(), slot_map_stop().end(), download_list_call(download));
std::for_each(slot_map_hash_removed().begin(), slot_map_hash_removed().end(), download_list_call(download));
download->variable()->set("state_changed", cachedTime.seconds());
@@ -488,12 +492,14 @@ DownloadList::confirm_finished(Download* download) {
control->core()->download_store()->save(download);
}
// Send the completed request before resuming so we don't reset the
// up/downloaded baseline.
download->download()->tracker_list().send_completed();
std::for_each(slot_map_finished().begin(), slot_map_finished().end(), download_list_call(download));
if (!download->is_active() && download->variable()->get_value("state") == 1)
resume(download);
download->download()->tracker_list().send_completed();
}
}