fixed assert in peer_connection invariant check

This commit is contained in:
Arvid Norberg 2009-05-30 04:03:57 +00:00
parent bc83387583
commit d25d09cb70
1 changed files with 2 additions and 0 deletions

View File

@ -4346,6 +4346,8 @@ namespace libtorrent
int block_size = t->block_size();
piece_block last_block(ti.num_pieces()-1
, (ti.total_size() & (ti.piece_length()-1)) / block_size);
if ((ti.total_size() & (ti.piece_length()-1)) == 0)
last_block.block_index = (ti.piece_length()-1) / block_size;
int last_block_size = t->torrent_file().total_size() & (block_size-1);
if (last_block_size == 0) last_block_size = block_size;
for (std::vector<pending_block>::const_iterator i = m_download_queue.begin()