report disk read-back when verifying piece hashes

This commit is contained in:
Arvid Norberg
2011-03-20 01:19:14 +00:00
parent afc9806319
commit 1b6227ad31
5 changed files with 13 additions and 5 deletions

View File

@@ -2190,7 +2190,8 @@ namespace libtorrent
ptime hash_start = time_now_hires();
sha1_hash h = j.storage->hash_for_piece_impl(j.piece);
int readback = 0;
sha1_hash h = j.storage->hash_for_piece_impl(j.piece, &readback);
if (test_error(j))
{
ret = -1;
@@ -2198,6 +2199,8 @@ namespace libtorrent
break;
}
m_cache_stats.total_read_back += readback / m_block_size;
ret = (j.storage->info()->hash_for_piece(j.piece) == h)?0:-2;
if (ret == -2) j.storage->mark_failed(j.piece);