* Clear the resume bitfield when resuming an incomplete download. This

will force rehashing if the program dies in a messy way.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@682 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-05-04 13:43:59 +00:00
parent 0620ea88a7
commit 8387dbde6f
+9 -2
View File
@@ -272,11 +272,18 @@ DownloadList::resume(Download* download) {
return;
}
if (download->is_done())
if (download->is_done()) {
download->set_connection_type(download->variable()->get_string("connection_seed"));
else
} else {
download->set_connection_type(download->variable()->get_string("connection_leech"));
// For the moment, clear the resume data so we force hash-check
// 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.
download->download()->hash_resume_clear();
}
// Update the priority to ensure it has the correct
// seeding/unfinished modifiers.
download->set_priority(download->priority());