Skip to content

Commit b1e0c58

Browse files
committed
Set prefer_udp_trackers=false by default.
1 parent 6ba310d commit b1e0c58

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

mag2tor.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,26 @@
1010
#include <libtorrent/bencode.hpp>
1111
#include <libtorrent/create_torrent.hpp>
1212
#include <libtorrent/session.hpp>
13+
#include <libtorrent/session_settings.hpp>
1314
#include <libtorrent/storage_defs.hpp> // lt::disabled_storage_constructor
1415
#include <libtorrent/torrent_handle.hpp>
1516
#include <libtorrent/torrent_info.hpp>
1617

1718
namespace lt = libtorrent;
1819
int main(int argc, char *argv[]) {
1920
std::set_terminate(__gnu_cxx::__verbose_terminate_handler);
21+
22+
lt::session_settings sset;
23+
sset.prefer_udp_trackers = false;
24+
2025
if (argc != 2) {
2126
std::cerr << "usage: " << argv[0] << " <magnet-url>" <<
2227
std::endl;
2328
return 1;
2429
}
2530

2631
lt::session sess;
32+
sess.set_settings(sset);
2733
lt::add_torrent_params atp;
2834
atp.url = argv[1];
2935
atp.upload_mode = true;

0 commit comments

Comments
 (0)