fixed bug in write resume data
This commit is contained in:
parent
31247c046a
commit
43a28e7a49
|
@ -564,9 +564,11 @@ namespace libtorrent
|
|||
for (int j = 0; j < num_bitmask_bytes; ++j)
|
||||
{
|
||||
unsigned char v = 0;
|
||||
for (int k = 0; k < 8; ++k)
|
||||
int bits = std::min(num_blocks_per_piece - j*8, 8);
|
||||
for (int k = 0; k < bits; ++k)
|
||||
v |= i->info[j*8+k].finished?(1 << k):0;
|
||||
bitmask.insert(bitmask.end(), v);
|
||||
assert(bits == 8 || j == num_bitmask_bytes - 1);
|
||||
}
|
||||
piece_struct["bitmask"] = bitmask;
|
||||
|
||||
|
|
Loading…
Reference in New Issue