back ported feature to expose which pieces have been verified in seed_mode and exposes it in client_test (initially implemented in the libtorrent_aio branch)

This commit is contained in:
Arvid Norberg
2011-08-07 07:19:18 +00:00
parent 9564636fd2
commit f6554bad08
5 changed files with 36 additions and 5 deletions

View File

@@ -1414,7 +1414,9 @@ int main(int argc, char* argv[])
// is a somewhat expensive operation, don't do it by default for
// all torrents
handles[active_torrent] = handles[active_torrent].handle.status(
torrent_handle::query_distributed_copies);
torrent_handle::query_distributed_copies
| torrent_handle::query_pieces
| torrent_handle::query_verified_pieces);
}
std::vector<feed_handle> feeds;
@@ -1853,12 +1855,19 @@ int main(int argc, char* argv[])
out += str;
++lines_printed;
if (print_piece_bar && s.state != torrent_status::seeding)
if (print_piece_bar && (s.state != torrent_status::seeding || s.seed_mode))
{
out += " ";
out += piece_bar(s.pieces, terminal_width - 7);
out += "\n";
++lines_printed;
if (s.seed_mode)
{
out += " ";
out += piece_bar(s.verified_pieces, terminal_width - 7);
out += "\n";
++lines_printed;
}
}
if (s.state != torrent_status::queued_for_checking && s.state != torrent_status::checking_files)