fix rp->blocks_left = blocks_in_piece;

This commit is contained in:
pavel.pimenov 2018-01-09 23:45:51 +03:00 committed by Arvid Norberg
parent 5f25912694
commit 263e01f5da
1 changed files with 1 additions and 2 deletions

View File

@ -821,13 +821,12 @@ namespace libtorrent {
get_handle(), piece, error_code(boost::system::errc::not_enough_memory, generic_category()));
return;
}
rp->blocks_left = 0;
rp->blocks_left = blocks_in_piece;
rp->fail = false;
peer_request r;
r.piece = piece;
r.start = 0;
rp->blocks_left = blocks_in_piece;
for (int i = 0; i < blocks_in_piece; ++i, r.start += block_size())
{
r.length = std::min(piece_size - r.start, block_size());