introduced TORRENT_NO_DEPRECATE, to disable deprecated functions. Made example not use deprecated functions. Documented magnet uri related functions.
This commit is contained in:
@@ -861,6 +861,7 @@ int main(int ac, char* av[])
|
||||
ses.set_peer_proxy(ps);
|
||||
ses.set_web_seed_proxy(ps);
|
||||
|
||||
#ifndef TORRENT_NO_DEPRECATE
|
||||
if (log_level == "debug")
|
||||
ses.set_severity_level(alert::debug);
|
||||
else if (log_level == "warning")
|
||||
@@ -869,6 +870,7 @@ int main(int ac, char* av[])
|
||||
ses.set_severity_level(alert::fatal);
|
||||
else
|
||||
ses.set_severity_level(alert::info);
|
||||
#endif
|
||||
|
||||
boost::filesystem::ifstream ses_state_file(".ses_state"
|
||||
, std::ios_base::binary);
|
||||
@@ -956,10 +958,12 @@ int main(int ac, char* av[])
|
||||
// first see if this is a torrentless download
|
||||
if (i->substr(0, 7) == "magnet:")
|
||||
{
|
||||
add_torrent_params p;
|
||||
p.save_path = save_path;
|
||||
p.storage_mode = compact_allocation_mode ? storage_mode_compact
|
||||
: storage_mode_sparse;
|
||||
std::cout << "adding MANGET link: " << *i << std::endl;
|
||||
torrent_handle h = add_magnet_uri(ses, *i, save_path
|
||||
, compact_allocation_mode ? storage_mode_compact
|
||||
: storage_mode_sparse);
|
||||
torrent_handle h = add_magnet_uri(ses, *i, p);
|
||||
|
||||
handles.insert(std::make_pair(std::string(), h));
|
||||
|
||||
|
@@ -60,7 +60,10 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
session s;
|
||||
s.listen_on(std::make_pair(6881, 6889));
|
||||
s.add_torrent(torrent_info(argv[1]), "./");
|
||||
add_torrent_params p;
|
||||
p.save_path = "./";
|
||||
p.ti = new torrent_info(argv[1]);
|
||||
s.add_torrent(p);
|
||||
|
||||
// wait for the user to end
|
||||
char a;
|
||||
|
Reference in New Issue
Block a user