From 9344dcc9b1ddb6855ce59d86a851163537fa7d14 Mon Sep 17 00:00:00 2001 From: arvidn Date: Mon, 3 Feb 2020 02:34:45 +0100 Subject: [PATCH] update make_torrent example to support controlling tracker tiers --- examples/make_torrent.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/make_torrent.cpp b/examples/make_torrent.cpp index 37fbd1527..3117e7b89 100644 --- a/examples/make_torrent.cpp +++ b/examples/make_torrent.cpp @@ -125,7 +125,8 @@ OPTIONS: the specified url -t url adds the specified tracker to the torrent. For multiple trackers, specify more - -t options + -t options. Specify a dash character "-" as a tracker to indicate + the following trackers should be in a higher tier. -c comment sets the comment to the specified string -C creator sets the created-by field to the specified string -p bytes enables padding files. Files larger @@ -288,8 +289,8 @@ int main(int argc_, char const* argv_[]) try lt::create_torrent t(fs, piece_size, pad_file_limit, flags); int tier = 0; for (std::string const& tr : trackers) { - t.add_tracker(tr, tier); - ++tier; + if (tr == "-") ++tier; + else t.add_tracker(tr, tier); } for (std::string const& ws : web_seeds)