updated for libtorrent-rasterbar 1.2.9
authoralex <[email protected]>
Sat, 31 Jul 2021 23:42:53 +0000 (16:42 -0700)
committeralex <[email protected]>
Sat, 31 Jul 2021 23:42:53 +0000 (16:42 -0700)
configure.ac
seederd/inc/seed.hpp
seederd/src/main.cpp

index 032b394a9882d6c700e456f895ca96ac3023590d..2310844ebb17331ff6723dfe7f3ad97cfeb8feab 100644 (file)
@@ -77,8 +77,6 @@ AC_PROG_LN_S
 
 # 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])
index 85b99dc44660e457f716e741b15d395758d772a4..381c2bd93c7bdb842e8a54b9f25f371ffb367f30 100644 (file)
@@ -2,8 +2,8 @@
 #define __SEED_HPP_
 
 #include<filesystem>
+#include<iostream>
 
-#include<boost/make_shared.hpp>
 #include<libtorrent/session.hpp>
 #include<libtorrent/torrent_info.hpp>
 
@@ -14,8 +14,8 @@ class seed {
                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);
                }
index e7b3383362f0a07627fa30b4a65e9846a881d596..fcb8b38072b20f0f6e4e8e57d7804b02e0794bd0 100644 (file)
@@ -62,8 +62,10 @@ int main(int argc, char **argv) try {
        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");
@@ -75,7 +77,6 @@ int main(int argc, char **argv) try {
                        & ~(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
@@ -85,7 +86,7 @@ int main(int argc, char **argv) try {
                ));
        }
 
-       lt::session session(settings);
+       lt::session session(params);
 
        init(session);