forked from premiere/premiere-libtorrent
updated dump_torrent examples to print DHT nodes from the torrent file
This commit is contained in:
parent
35c6fc413c
commit
e8c43c868f
9
Jamfile
9
Jamfile
|
@ -135,15 +135,6 @@ LIBS = ;
|
|||
LIBS += wsock32 ;
|
||||
}
|
||||
|
||||
#lib torrent
|
||||
# :
|
||||
# src/$(SOURCES)
|
||||
# src/$(KADEMLIA_SOURCES)
|
||||
# zlib/$(ZLIB_SOURCES)
|
||||
# $(LIBS)
|
||||
# ;
|
||||
|
||||
# if DHT support is disabled, don't include the kademlia sources
|
||||
lib torrent
|
||||
:
|
||||
src/$(SOURCES)
|
||||
|
|
|
@ -74,6 +74,15 @@ int main(int argc, char* argv[])
|
|||
|
||||
// print info about torrent
|
||||
std::cout << "\n\n----- torrent file info -----\n\n";
|
||||
std::cout << "nodes:\n";
|
||||
typedef std::vector<std::pair<std::string, int> > node_vec;
|
||||
node_vec const& nodes = t.nodes();
|
||||
for (node_vec::const_iterator i = nodes.begin(), end(nodes.end());
|
||||
i != end; ++i)
|
||||
{
|
||||
std::cout << i->first << ":" << i->second << "\n";
|
||||
}
|
||||
|
||||
std::cout << "trackers:\n";
|
||||
for (std::vector<announce_entry>::const_iterator i
|
||||
= t.trackers().begin(); i != t.trackers().end(); ++i)
|
||||
|
|
|
@ -58,6 +58,15 @@ print information about it to std out::
|
|||
|
||||
// print info about torrent
|
||||
std::cout << "\n\n----- torrent file info -----\n\n";
|
||||
std::cout << "nodes:\n";
|
||||
typedef std::vector<std::pair<std::string, int> > node_vec;
|
||||
node_vec const& nodes = t.nodes();
|
||||
for (node_vec::const_iterator i = nodes.begin(), end(nodes.end());
|
||||
i != end; ++i)
|
||||
{
|
||||
std::cout << i->first << ":" << i->second << "\n";
|
||||
}
|
||||
|
||||
std::cout << "trackers:\n";
|
||||
for (std::vector<announce_entry>::const_iterator i
|
||||
= t.trackers().begin(); i != t.trackers().end(); ++i)
|
||||
|
|
|
@ -65,6 +65,14 @@ int main(int argc, char* argv[])
|
|||
|
||||
// print info about torrent
|
||||
std::cout << "\n\n----- torrent file info -----\n\n";
|
||||
std::cout << "nodes:\n";
|
||||
typedef std::vector<std::pair<std::string, int> > node_vec;
|
||||
node_vec const& nodes = t.nodes();
|
||||
for (node_vec::const_iterator i = nodes.begin(), end(nodes.end());
|
||||
i != end; ++i)
|
||||
{
|
||||
std::cout << i->first << ":" << i->second << "\n";
|
||||
}
|
||||
std::cout << "trackers:\n";
|
||||
for (std::vector<announce_entry>::const_iterator i = t.trackers().begin();
|
||||
i != t.trackers().end(); ++i)
|
||||
|
|
Loading…
Reference in New Issue