fixed file checking bug introduced by fancy disk IO optimizations

This commit is contained in:
Arvid Norberg 2010-01-13 23:37:23 +00:00
parent cfba431843
commit 2948b3b375
1 changed files with 4 additions and 1 deletions

View File

@ -1278,7 +1278,6 @@ namespace libtorrent
, boost::function<void(int, disk_io_job const&)> const& f)
{
TORRENT_ASSERT(!m_abort);
TORRENT_ASSERT(!j.callback);
TORRENT_ASSERT(j.storage
|| j.action == disk_io_job::abort_thread
|| j.action == disk_io_job::update_settings);
@ -1448,6 +1447,7 @@ namespace libtorrent
}
}
TORRENT_ASSERT(j.offset >= 0);
if (m_settings.allow_reordered_disk_operations && defer)
{
#ifdef TORRENT_DISK_STATS
@ -2023,6 +2023,9 @@ namespace libtorrent
// if the check is not done, add it at the end of the job queue
if (ret == piece_manager::need_full_check)
{
// offset needs to be reset to 0 so that the disk
// job sorting can be done correctly
j.offset = 0;
add_job(j, j.callback);
continue;
}