forked from premiere/premiere-libtorrent
made examples use the new more efficient torrent_info constructor
This commit is contained in:
parent
c50a538d99
commit
9780d378ed
|
@ -479,10 +479,7 @@ void add_torrent(libtorrent::session& ses
|
|||
{
|
||||
using namespace libtorrent;
|
||||
|
||||
std::ifstream in(torrent.c_str(), std::ios_base::binary);
|
||||
in.unsetf(std::ios_base::skipws);
|
||||
entry e = bdecode(std::istream_iterator<char>(in), std::istream_iterator<char>());
|
||||
boost::intrusive_ptr<torrent_info> t(new torrent_info(e));
|
||||
boost::intrusive_ptr<torrent_info> t(new torrent_info(torrent.c_str()));
|
||||
|
||||
std::cout << t->name() << "\n";
|
||||
|
||||
|
|
|
@ -60,11 +60,7 @@ int main(int argc, char* argv[])
|
|||
{
|
||||
session s;
|
||||
s.listen_on(std::make_pair(6881, 6889));
|
||||
|
||||
std::ifstream in(argv[1], std::ios_base::binary);
|
||||
in.unsetf(std::ios_base::skipws);
|
||||
entry e = bdecode(std::istream_iterator<char>(in), std::istream_iterator<char>());
|
||||
s.add_torrent(torrent_info(e), "./");
|
||||
s.add_torrent(torrent_info(argv[1]), "./");
|
||||
|
||||
// wait for the user to end
|
||||
char a;
|
||||
|
|
Loading…
Reference in New Issue