fixed rare piece picker bug

This commit is contained in:
Arvid Norberg 2011-11-07 04:31:48 +00:00
parent f39b6b19e9
commit 57e7f14024
2 changed files with 4 additions and 9 deletions

View File

@ -94,6 +94,7 @@
incoming connection
* added more detailed instrumentation of the disk I/O thread
* fixed rare piece picker bug
* fixed invalid torrent_status::finished_time
* fixed bugs in dont-have and upload-only extension messages
* don't open files in random-access mode (speeds up hashing)

View File

@ -833,14 +833,8 @@ namespace libtorrent
if (new_priority == prev_priority) return;
if (m_dirty) return;
if (prev_priority == -1)
{
add(index);
}
else
{
update(prev_priority, p.index);
}
if (prev_priority == -1) add(index);
else update(prev_priority, p.index);
}
void piece_picker::inc_refcount_all()
@ -2252,7 +2246,7 @@ namespace libtorrent
if (m_dirty) return;
if (new_priority == prev_priority) return;
if (prev_priority == -1) add(p.index);
if (prev_priority == -1) add(block.piece_index);
else update(prev_priority, p.index);
}
else