From c5fd5ecfb4de959ef8707f3a01212bf5058b5ef3 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 11 Feb 2008 07:18:28 +0000 Subject: [PATCH] removed 'adler32' key from fastresume, since it was implemented with blocking I/O --- src/session_impl.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index bc20fb02c..dd2ae93ae 100755 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -2683,21 +2683,23 @@ namespace detail TORRENT_ASSERT(*slot_iter == p.index); int slot_index = static_cast(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(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(p.index); + return; + } } tmp_unfinished.push_back(p);