modified the hueristic for taking over blocks slightly, added logging

This commit is contained in:
Arvid Norberg
2006-12-15 10:42:56 +00:00
parent 1271334f95
commit 79ebcf5dd8
4 changed files with 32 additions and 16 deletions

View File

@@ -1163,14 +1163,17 @@ namespace libtorrent
assert(block.block_index < blocks_in_piece(block.piece_index));
#ifndef NDEBUG
if (i->requested_blocks[block.block_index] != 1)
if (i->requested_blocks[block.block_index] == false)
{
assert(false);
}
#endif
// clear this block as being downloaded
i->requested_blocks[block.block_index] = 0;
i->requested_blocks[block.block_index] = false;
// clear the downloader of this block
i->info[block.block_index].peer = tcp::endpoint();
// if there are no other blocks in this piece
// that's being downloaded, remove it from the list