forked from premiere/premiere-libtorrent
fix rp->blocks_left = blocks_in_piece;
This commit is contained in:
parent
5f25912694
commit
263e01f5da
|
@ -821,13 +821,12 @@ namespace libtorrent {
|
||||||
get_handle(), piece, error_code(boost::system::errc::not_enough_memory, generic_category()));
|
get_handle(), piece, error_code(boost::system::errc::not_enough_memory, generic_category()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rp->blocks_left = 0;
|
rp->blocks_left = blocks_in_piece;
|
||||||
rp->fail = false;
|
rp->fail = false;
|
||||||
|
|
||||||
peer_request r;
|
peer_request r;
|
||||||
r.piece = piece;
|
r.piece = piece;
|
||||||
r.start = 0;
|
r.start = 0;
|
||||||
rp->blocks_left = blocks_in_piece;
|
|
||||||
for (int i = 0; i < blocks_in_piece; ++i, r.start += block_size())
|
for (int i = 0; i < blocks_in_piece; ++i, r.start += block_size())
|
||||||
{
|
{
|
||||||
r.length = std::min(piece_size - r.start, block_size());
|
r.length = std::min(piece_size - r.start, block_size());
|
||||||
|
|
Loading…
Reference in New Issue