return a full bitmask for pieces when seeding, don't allocate empty allocations for 0-sized bitmasks

This commit is contained in:
Arvid Norberg 2011-07-26 01:52:51 +00:00
parent f722d2951a
commit 98157176c2
1 changed files with 5 additions and 0 deletions

View File

@ -7583,6 +7583,11 @@ namespace libtorrent
for (int i = 0; i < num_pieces; ++i)
if (m_picker->have_piece(i)) st->pieces.set_bit(i);
}
else if (is_seed())
{
int num_pieces = m_picker->num_pieces();
st->pieces.resize(num_pieces, true);
}
st->num_pieces = num_have();
st->num_seeds = num_seeds();
if ((flags & torrent_handle::query_distributed_copies) && m_picker.get())