From 98157176c2604fec39e0ce677a93387d028adb87 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 26 Jul 2011 01:52:51 +0000 Subject: [PATCH] return a full bitmask for pieces when seeding, don't allocate empty allocations for 0-sized bitmasks --- src/torrent.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/torrent.cpp b/src/torrent.cpp index 5d7fa48e9..fcc7984c8 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -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())