removed 'adler32' key from fastresume, since it was implemented with blocking I/O

This commit is contained in:
Arvid Norberg 2008-02-11 07:18:28 +00:00
parent 601b7571f5
commit c5fd5ecfb4
1 changed files with 14 additions and 12 deletions

View File

@ -2683,21 +2683,23 @@ namespace detail
TORRENT_ASSERT(*slot_iter == p.index);
int slot_index = static_cast<int>(slot_iter - tmp_pieces.begin());
unsigned long adler
= torrent_ptr->filesystem().piece_crc(
slot_index
, torrent_ptr->block_size()
, p.info);
const entry* ad = i->find_key("adler32");
// crc's didn't match, don't use the resume data
if (ad && ad->type() == entry::int_t
&& ad->integer() != entry::integer_type(adler))
if (ad && ad->type() == entry::int_t)
{
error = "checksum mismatch on piece "
+ boost::lexical_cast<std::string>(p.index);
return;
unsigned long adler
= torrent_ptr->filesystem().piece_crc(
slot_index
, torrent_ptr->block_size()
, p.info);
// crc's didn't match, don't use the resume data
if (ad->integer() != entry::integer_type(adler))
{
error = "checksum mismatch on piece "
+ boost::lexical_cast<std::string>(p.index);
return;
}
}
tmp_unfinished.push_back(p);