forked from premiere/premiere-libtorrent
fixed assert in peer_connection invariant check
This commit is contained in:
parent
bc83387583
commit
d25d09cb70
|
@ -4346,6 +4346,8 @@ namespace libtorrent
|
||||||
int block_size = t->block_size();
|
int block_size = t->block_size();
|
||||||
piece_block last_block(ti.num_pieces()-1
|
piece_block last_block(ti.num_pieces()-1
|
||||||
, (ti.total_size() & (ti.piece_length()-1)) / block_size);
|
, (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);
|
int last_block_size = t->torrent_file().total_size() & (block_size-1);
|
||||||
if (last_block_size == 0) last_block_size = block_size;
|
if (last_block_size == 0) last_block_size = block_size;
|
||||||
for (std::vector<pending_block>::const_iterator i = m_download_queue.begin()
|
for (std::vector<pending_block>::const_iterator i = m_download_queue.begin()
|
||||||
|
|
Loading…
Reference in New Issue