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;
|
using namespace libtorrent;
|
||||||
|
|
||||||
std::ifstream in(torrent.c_str(), std::ios_base::binary);
|
boost::intrusive_ptr<torrent_info> t(new torrent_info(torrent.c_str()));
|
||||||
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));
|
|
||||||
|
|
||||||
std::cout << t->name() << "\n";
|
std::cout << t->name() << "\n";
|
||||||
|
|
||||||
|
|
|
@ -60,11 +60,7 @@ int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
session s;
|
session s;
|
||||||
s.listen_on(std::make_pair(6881, 6889));
|
s.listen_on(std::make_pair(6881, 6889));
|
||||||
|
s.add_torrent(torrent_info(argv[1]), "./");
|
||||||
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), "./");
|
|
||||||
|
|
||||||
// wait for the user to end
|
// wait for the user to end
|
||||||
char a;
|
char a;
|
||||||
|
|
Loading…
Reference in New Issue