From 8387dbde6f6681dbfb06f446213305d85317e556 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Thu, 4 May 2006 13:43:59 +0000 Subject: [PATCH] * 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 --- src/core/download_list.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/download_list.cc b/src/core/download_list.cc index 4a26b423..25cb63e1 100644 --- a/src/core/download_list.cc +++ b/src/core/download_list.cc @@ -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());