# Checks for libraries.
AC_CHECK_LIB([torrent-rasterbar], [main],,AC_MSG_ERROR(libtorrent-rasterbar required))
-AC_CHECK_LIB([boost_system], [main],,AC_MSG_ERROR(boost_system required))
-AC_CHECK_LIB([pthread], [main],,AC_MSG_ERROR(pthread required))
# Checks for header files.
AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
#define __SEED_HPP_
#include<filesystem>
+#include<iostream>
-#include<boost/make_shared.hpp>
#include<libtorrent/session.hpp>
#include<libtorrent/torrent_info.hpp>
seed(lt::session& session, std::string torrent_filepath, std::string data_path) {
lt::add_torrent_params params;
params.save_path = data_path;
- params.ti = boost::make_shared<lt::torrent_info>(torrent_filepath,0);
- params.flags = lt::add_torrent_params::flag_seed_mode;
+ params.ti = std::make_shared<lt::torrent_info>(torrent_filepath);
+ params.flags = lt::torrent_flags::seed_mode;
session.async_add_torrent(params);
}
fs::create_directories(TORRENTDIR);
std::cout << "created " << TORRENTDIR << std::endl;
- lt::settings_pack settings;
- lt::high_performance_seed(settings);
+ lt::session_params params;
+ auto& settings = params.settings;
+
+ settings = lt::high_performance_seed();
settings.set_int(lt::settings_pack::active_seeds,-1);
settings.set_int(lt::settings_pack::active_limit,-1);
settings.set_str(lt::settings_pack::listen_interfaces,"0.0.0.0:6881");
& ~(lt::alert::dht_notification
+ lt::alert::piece_progress_notification
+ lt::alert::block_progress_notification
- + lt::alert::progress_notification
+ lt::alert::stats_notification
+ lt::alert::session_log_notification
+ lt::alert::torrent_log_notification
));
}
- lt::session session(settings);
+ lt::session session(params);
init(session);