From c679390392fb4e3d34ace91fd1a6802d8bbb3d51 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 3 Dec 2016 16:27:29 +0900 Subject: [PATCH] Print DHT nodes with -S option --- src/bittorrent_helper.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bittorrent_helper.h b/src/bittorrent_helper.h index 795dc639..daa72e37 100644 --- a/src/bittorrent_helper.h +++ b/src/bittorrent_helper.h @@ -375,6 +375,12 @@ void print(Output& o, const std::shared_ptr& dctx) o.printf(" %s\n", (*i).c_str()); } } + if (!torrentAttrs->nodes.empty()) { + o.write("Nodes:\n"); + for (auto& p : torrentAttrs->nodes) { + o.printf(" %s:%u\n", p.first.c_str(), p.second); + } + } o.printf("Name: %s\n", torrentAttrs->name.c_str()); o.printf("Magnet URI: %s\n", torrent2Magnet(torrentAttrs).c_str()); util::toStream(dctx->getFileEntries().begin(), dctx->getFileEntries().end(),