diff --git a/net-p2p/libtorrent/Makefile b/net-p2p/libtorrent/Makefile index 5ed69ce3f817..ea7f8b46a775 100644 --- a/net-p2p/libtorrent/Makefile +++ b/net-p2p/libtorrent/Makefile @@ -1,44 +1,49 @@ PORTNAME= libtorrent -DISTVERSION= 0.15.2 +DISTVERSION= 0.15.3 CATEGORIES= net-p2p MASTER_SITES= https://github.com/rakshasa/rtorrent/releases/download/v${DISTVERSION}/ MAINTAINER= eduardo@FreeBSD.org COMMENT= BitTorrent Library written in C++ WWW= https://github.com/rakshasa/libtorrent LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING +TEST_DEPENDS= cppunit>0:devel/cppunit + USES= compiler:c++17-lang cpe libtool localbase:ldflags pathfix \ pkgconfig ssl USE_LDCONFIG= yes GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-debug CONFIGURE_ENV= OPENSSL_CFLAGS="-I ${OPENSSLINC}" \ OPENSSL_LIBS="-L${OPENSSLLIB} -lcrypto" # This makes sure that /usr/local/lib appears before /usr/lib when # linking libtorrent to avoid linking with base's libcrypto. MAKE_ARGS= LDFLAGS="${LDFLAGS}" INSTALL_TARGET= install-strip +TEST_TARGET= check + +TESTING_UNSAFE= https://github.com/rakshasa/libtorrent/issues/292 OPTIONS_DEFINE= KQUEUE OPTIONS_DEFAULT= KQUEUE KQUEUE_DESC= Use kqueue(2) support KQUEUE_CONFIGURE_WITH= kqueue .include # Disable instrumentation, which requires 64-bit atomic ops, on i386 when using # gcc to avoid linking errors: # /usr/local/lib/libtorrent.so: undefined reference to `__sync_add_and_fetch_8' # /usr/local/lib/libtorrent.so: undefined reference to `__sync_fetch_and_and_8' .if ${ARCH} == i386 && ${CHOSEN_COMPILER_TYPE} == gcc CONFIGURE_ARGS+= --disable-instrumentation .endif .include diff --git a/net-p2p/libtorrent/distinfo b/net-p2p/libtorrent/distinfo index 381d37068636..965575747ed9 100644 --- a/net-p2p/libtorrent/distinfo +++ b/net-p2p/libtorrent/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1743202037 -SHA256 (libtorrent-0.15.2.tar.gz) = 4636b10776f123c09a6de1a1a18dd6427e7a87535682defad31530c463005f2e -SIZE (libtorrent-0.15.2.tar.gz) = 867838 +TIMESTAMP = 1746176226 +SHA256 (libtorrent-0.15.3.tar.gz) = 6a0b01e4c0da817fc06fa0cd0ca539d79a19eaed617e16da9e2d8ba066ea95dd +SIZE (libtorrent-0.15.3.tar.gz) = 872751 diff --git a/net-p2p/libtorrent/files/patch-Fixed_DhtController b/net-p2p/libtorrent/files/patch-Fixed_DhtController deleted file mode 100644 index 23b76bb2f605..000000000000 --- a/net-p2p/libtorrent/files/patch-Fixed_DhtController +++ /dev/null @@ -1,305 +0,0 @@ -commit 01fc34516ef9fcff3cffc9d224c6870a8eb7eff6 -Author: rakshasa -Date: Sat Mar 29 07:32:25 2025 +0100 - - Fixed DhtController::m_router check and log unit tests. - -diff --git src/torrent/tracker/dht_controller.cc src/torrent/tracker/dht_controller.cc -index 2d0afcf6..c43e1dd7 100644 ---- src/torrent/tracker/dht_controller.cc -+++ src/torrent/tracker/dht_controller.cc -@@ -101,13 +101,13 @@ DhtController::set_receive_requests(bool state) { - - void - DhtController::add_node(const sockaddr* sa, int port) { -- if (!m_router) -+ if (m_router) - m_router->contact(sa, port); - } - - void - DhtController::add_node(const std::string& host, int port) { -- if (!m_router) -+ if (m_router) - m_router->add_contact(host, port); - } - -@@ -121,11 +121,17 @@ DhtController::store_cache(Object* container) { - - DhtController::statistics_type - DhtController::get_statistics() const { -+ if (!m_router) -+ throw internal_error("DhtController::get_statistics called but DHT not initialized."); -+ - return m_router->get_statistics(); - } - - void - DhtController::reset_statistics() { -+ if (!m_router) -+ throw internal_error("DhtController::reset_statistics called but DHT not initialized."); -+ - m_router->reset_statistics(); - } - -@@ -133,6 +139,9 @@ DhtController::reset_statistics() { - - void - DhtController::set_upload_throttle(Throttle* t) { -+ if (!m_router) -+ throw internal_error("DhtController::set_upload_throttle() called but DHT not initialized."); -+ - if (m_router->is_active()) - throw internal_error("DhtController::set_upload_throttle() called while DHT server active."); - -@@ -141,6 +150,9 @@ DhtController::set_upload_throttle(Throttle* t) { - - void - DhtController::set_download_throttle(Throttle* t) { -+ if (!m_router) -+ throw internal_error("DhtController::set_download_throttle() called but DHT not initialized."); -+ - if (m_router->is_active()) - throw internal_error("DhtController::set_download_throttle() called while DHT server active."); - -diff --git src/torrent/utils/log.cc src/torrent/utils/log.cc -index a587cdfe..1c7a4362 100644 ---- src/torrent/utils/log.cc -+++ src/torrent/utils/log.cc -@@ -45,12 +45,12 @@ struct log_gz_output { - gzFile gz_file; - }; - --typedef std::vector log_cache_list; --typedef std::vector > log_child_list; --typedef std::vector log_slot_list; --typedef std::vector > log_output_list; -+typedef std::vector log_cache_list; -+typedef std::vector> log_child_list; -+typedef std::vector log_slot_list; -+typedef std::vector> log_output_list; - --log_output_list log_outputs; -+log_output_list log_outputs LIBTORRENT_EXPORT; - log_child_list log_children; - log_cache_list log_cache; - log_group_list log_groups; -@@ -105,10 +105,10 @@ log_rebuild_cache() { - continue; - } - -- log_cache_list::iterator cache_itr = -+ log_cache_list::iterator cache_itr = - std::find_if(log_cache.begin(), log_cache.end(), - std::bind(&log_cache_entry::equal_outputs, std::placeholders::_1, use_outputs)); -- -+ - if (cache_itr == log_cache.end()) { - cache_itr = log_cache.insert(log_cache.end(), log_cache_entry()); - cache_itr->outputs = use_outputs; -@@ -282,13 +282,11 @@ log_add_group_output(int group, const char* name) { - log_output_list::iterator itr = log_find_output_name(name); - size_t index = std::distance(log_outputs.begin(), itr); - -- if (itr == log_outputs.end()) { -- throw input_error("Log name not found."); -- } -+ if (itr == log_outputs.end()) -+ throw input_error("Log name not found: '" + std::string(name) + "'"); - -- if (index >= log_group::max_size_outputs()) { -+ if (index >= log_group::max_size_outputs()) - throw input_error("Cannot add more log group outputs."); -- } - - log_groups[group].set_output_at(index, true); - log_rebuild_cache(); -@@ -346,7 +344,7 @@ log_gz_file_write(std::shared_ptr& outfile, const char* data, siz - int buffer_length = snprintf(buffer, 64, GROUPFMT, - cachedTime.seconds(), - log_level_char[group % 6]); -- -+ - if (buffer_length > 0) - gzwrite(outfile->gz_file, buffer, buffer_length); - -@@ -355,7 +353,7 @@ log_gz_file_write(std::shared_ptr& outfile, const char* data, siz - - } else if (group == -1) { - gzwrite(outfile->gz_file, "---DUMP---\n", sizeof("---DUMP---\n") - 1); -- -+ - if (length != 0) - gzwrite(outfile->gz_file, data, length); - -diff --git src/torrent/utils/log_buffer.h src/torrent/utils/log_buffer.h -index 025192c1..41f9d5ef 100644 ---- src/torrent/utils/log_buffer.h -+++ src/torrent/utils/log_buffer.h -@@ -8,6 +8,8 @@ - #include - #include - -+#include -+ - namespace torrent { - - struct log_entry { -@@ -23,7 +25,7 @@ struct log_entry { - std::string message; - }; - --class [[gnu::visibility("default")]] log_buffer : private std::deque { -+class LIBTORRENT_EXPORT log_buffer : private std::deque { - public: - typedef std::deque base_type; - typedef std::function slot_void; -@@ -47,7 +49,7 @@ public: - m_max_size(200) {} - - unsigned int max_size() const { return m_max_size; } -- -+ - // Always lock before calling any function. - void lock() { m_lock.lock(); } - void unlock() { m_lock.unlock(); } -@@ -66,7 +68,7 @@ private: - - typedef std::unique_ptr> log_buffer_ptr; - --[[gnu::visibility("default")]] log_buffer_ptr log_open_log_buffer(const char* name); -+log_buffer_ptr log_open_log_buffer(const char* name) LIBTORRENT_EXPORT; - - } - -diff --git test/Makefile.am test/Makefile.am -index d0d98da9..87ae61d2 100644 ---- test/Makefile.am -+++ test/Makefile.am -@@ -9,6 +9,9 @@ TESTS = \ - - check_PROGRAMS = $(TESTS) - -+# This can cause duplicate symbols, so export anything that causes issues. -+ -+# LibTorrent_Test_LDADD = ../src/libtorrent.la - LibTorrent_Test_LDADD = \ - ../src/libtorrent.la \ - ../src/libtorrent_other.la \ -diff --git test/helpers/progress_listener.cc test/helpers/progress_listener.cc -index 7a6ed047..e7f000fc 100644 ---- test/helpers/progress_listener.cc -+++ test/helpers/progress_listener.cc -@@ -10,6 +10,8 @@ - #include "torrent/utils/log.h" - #include "torrent/utils/log_buffer.h" - -+#include -+ - static std::string - get_test_path(const test_list_type& tl) { - if (tl.size() < 2) -diff --git test/helpers/test_fixture.cc test/helpers/test_fixture.cc -index 4d8d7214..3d766ea0 100644 ---- test/helpers/test_fixture.cc -+++ test/helpers/test_fixture.cc -@@ -1,18 +1,20 @@ --#include "config.h" -- --#include "test_fixture.h" -- --#include "torrent/utils/log.h" -- --void --test_fixture::setUp() { -- mock_init(); -- -- log_add_group_output(torrent::LOG_CONNECTION_BIND, "test_output"); -- log_add_group_output(torrent::LOG_CONNECTION_FD, "test_output"); --} -- --void --test_fixture::tearDown() { -- mock_cleanup(); --} -+#include "config.h" -+ -+#include "test_fixture.h" -+ -+#include "torrent/utils/log.h" -+ -+#include -+ -+void -+test_fixture::setUp() { -+ mock_init(); -+ -+ log_add_group_output(torrent::LOG_CONNECTION_BIND, "test_output"); -+ log_add_group_output(torrent::LOG_CONNECTION_FD, "test_output"); -+} -+ -+void -+test_fixture::tearDown() { -+ mock_cleanup(); -+} -diff --git test/torrent/utils/test_log.cc test/torrent/utils/test_log.cc -index 8ab8ed87..214866a8 100644 ---- test/torrent/utils/test_log.cc -+++ test/torrent/utils/test_log.cc -@@ -9,8 +9,8 @@ - #include - #include - --#include --#include -+#include "torrent/exceptions.h" -+#include "torrent/utils/log.h" - - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(test_log, "torrent/utils"); - -@@ -97,12 +97,12 @@ test_log::test_print() { - open_output("test_print_1", 0x1); - open_output("test_print_2", 0x2); - torrent::log_add_group_output(0, "test_print_1"); -- -+ - LTUNIT_ASSERT_OUTPUT(0, 0x1, "foo_bar", "foo_bar"); - LTUNIT_ASSERT_OUTPUT(0, 0x1, "foo 123 bar", "foo %i %s", 123, "bar"); - - torrent::log_add_group_output(0, "test_print_2"); -- -+ - LTUNIT_ASSERT_OUTPUT(0, 0x1|0x2, "test_multiple", "test_multiple"); - } - -@@ -144,7 +144,7 @@ test_log::test_file_output() { - - torrent::log_open_file_output("test_file", filename.c_str()); - torrent::log_add_group_output(GROUP_PARENT_1, "test_file"); -- -+ - lt_log_print(GROUP_PARENT_1, "test_file"); - - torrent::log_cleanup(); // To ensure we flush the buffers. -@@ -152,7 +152,7 @@ test_log::test_file_output() { - std::ifstream temp_file(filename.c_str()); - - CPPUNIT_ASSERT(temp_file.good()); -- -+ - char buffer[256]; - temp_file.getline(buffer, 256); - -diff --git test/torrent/utils/test_log_buffer.cc test/torrent/utils/test_log_buffer.cc -index 58412750..60732273 100644 ---- test/torrent/utils/test_log_buffer.cc -+++ test/torrent/utils/test_log_buffer.cc -@@ -3,7 +3,7 @@ - #include "test_log_buffer.h" - - #include "globals.h" --#include -+#include "torrent/utils/log_buffer.h" - - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(test_log_buffer, "torrent/utils"); - diff --git a/net-p2p/libtorrent/files/patch-configure b/net-p2p/libtorrent/files/patch-configure deleted file mode 100644 index 3e660da1b9b1..000000000000 --- a/net-p2p/libtorrent/files/patch-configure +++ /dev/null @@ -1,14 +0,0 @@ -Fixed configure script compatibility issue. -Applied manually on configure from 2943255ebaf5c7a574e8c14b474fb6cf2562f77a - ---- configure.orig 2025-03-28 22:55:28 UTC -+++ configure -@@ -17383,7 +17383,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - CXX="$CXX" - else - result=`echo "${values_to_check}" | $GREP -Fvx -- "${unwanted_values}" | $GREP -v '^$'` -- CXX=${result//$'\n'/ } -+ CXX=$(echo "$result" | tr -d '\n') - fi - - diff --git a/net-p2p/libtorrent/pkg-plist b/net-p2p/libtorrent/pkg-plist index 05694e95a727..41397c0111b1 100644 --- a/net-p2p/libtorrent/pkg-plist +++ b/net-p2p/libtorrent/pkg-plist @@ -1,77 +1,78 @@ include/torrent/bitfield.h include/torrent/chunk_manager.h include/torrent/common.h include/torrent/connection_manager.h include/torrent/data/block.h include/torrent/data/block_list.h include/torrent/data/block_transfer.h include/torrent/data/chunk_utils.h include/torrent/data/download_data.h include/torrent/data/file.h include/torrent/data/file_list.h include/torrent/data/file_list_iterator.h include/torrent/data/file_manager.h include/torrent/data/file_utils.h include/torrent/data/piece.h include/torrent/data/transfer_list.h include/torrent/download.h include/torrent/download/choke_group.h include/torrent/download/choke_queue.h include/torrent/download/download_manager.h include/torrent/download/group_entry.h include/torrent/download/resource_manager.h include/torrent/download_info.h include/torrent/error.h include/torrent/event.h include/torrent/exceptions.h include/torrent/hash_string.h include/torrent/http.h include/torrent/net/address_info.h include/torrent/net/fd.h include/torrent/net/resolver.h include/torrent/net/socket_address.h include/torrent/net/socket_address_key.h include/torrent/net/socket_event.h include/torrent/net/types.h include/torrent/net/utils.h include/torrent/object.h include/torrent/object_raw_bencode.h include/torrent/object_static_map.h include/torrent/object_stream.h include/torrent/path.h include/torrent/peer/choke_status.h include/torrent/peer/client_info.h include/torrent/peer/client_list.h include/torrent/peer/connection_list.h include/torrent/peer/peer.h include/torrent/peer/peer_info.h include/torrent/peer/peer_list.h include/torrent/poll.h include/torrent/poll_epoll.h include/torrent/poll_kqueue.h include/torrent/poll_select.h include/torrent/rate.h include/torrent/throttle.h include/torrent/torrent.h include/torrent/tracker/dht_controller.h include/torrent/tracker/manager.h include/torrent/tracker/tracker.h include/torrent/tracker/tracker_state.h include/torrent/tracker/wrappers.h include/torrent/tracker_controller.h include/torrent/tracker_list.h +include/torrent/utils/chrono.h include/torrent/utils/directory_events.h include/torrent/utils/extents.h include/torrent/utils/log.h include/torrent/utils/log_buffer.h include/torrent/utils/option_strings.h include/torrent/utils/ranges.h include/torrent/utils/resume.h +include/torrent/utils/scheduler.h include/torrent/utils/signal_bitfield.h include/torrent/utils/thread.h -include/torrent/utils/thread_interrupt.h include/torrent/utils/uri_parser.h lib/libtorrent.so lib/libtorrent.so.24 lib/libtorrent.so.24.0.0 libdata/pkgconfig/libtorrent.pc diff --git a/net-p2p/rtorrent/Makefile b/net-p2p/rtorrent/Makefile index 9f200ea388a8..2e2f693b9ea6 100644 --- a/net-p2p/rtorrent/Makefile +++ b/net-p2p/rtorrent/Makefile @@ -1,47 +1,47 @@ PORTNAME= rtorrent -DISTVERSION= 0.15.2 +DISTVERSION= 0.15.3 CATEGORIES= net-p2p MASTER_SITES= https://github.com/rakshasa/rtorrent/releases/download/v${DISTVERSION}/ MAINTAINER= eduardo@FreeBSD.org COMMENT= BitTorrent Client written in C++ WWW= https://github.com/rakshasa/rtorrent LICENSE= GPLv2 GPLv3 LICENSE_COMB= dual LICENSE_FILE_GPLv2= ${WRKSRC}/COPYING LIB_DEPENDS= libcurl.so:ftp/curl \ libtorrent.so:net-p2p/libtorrent USES= compiler:c++17-lang ncurses pkgconfig GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-debug LDFLAGS+= -lexecinfo -pthread SUB_FILES= pkg-message PLIST_FILES= bin/rtorrent PORTDOCS= README PORTEXAMPLES= rtorrent.rc OPTIONS_DEFINE= DOCS EXAMPLES IPV6 OPTIONS_DEFAULT= TINYXML OPTIONS_RADIO= XML OPTIONS_RADIO_XML= TINYXML XMLRPC XMLRPC_DESC= Compile with xmlrpc-c support IPV6_CONFIGURE_ENABLE= ipv6 TINYXML_CONFIGURE_ON= --with-xmlrpc-tinyxml2 XMLRPC_LIB_DEPENDS= libxmlrpc.so:net/xmlrpc-c XMLRPC_CONFIGURE_ON= --with-xmlrpc-c post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR}/ ${INSTALL_DATA} ${WRKSRC}/${PORTDOCS} ${STAGEDIR}${DOCSDIR}/ post-install-EXAMPLES-on: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/ ${INSTALL_DATA} ${WRKSRC}/doc/rtorrent.rc ${STAGEDIR}${EXAMPLESDIR}/ .include diff --git a/net-p2p/rtorrent/distinfo b/net-p2p/rtorrent/distinfo index f1dc84144faa..3f0058abc275 100644 --- a/net-p2p/rtorrent/distinfo +++ b/net-p2p/rtorrent/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1743204418 -SHA256 (rtorrent-0.15.2.tar.gz) = d10fd7d392d5d1e599ccf54238270df8b14b03fcc7cb8f62778ab868af6b0e5d -SIZE (rtorrent-0.15.2.tar.gz) = 858419 +TIMESTAMP = 1746177185 +SHA256 (rtorrent-0.15.3.tar.gz) = 6dfd42c19e6ff2f5ee8b99855314cef4f10bd669663c2670cc85fd6a4e2c4e40 +SIZE (rtorrent-0.15.3.tar.gz) = 858703 diff --git a/net-p2p/rtorrent/files/patch-Fixed_RpcManager b/net-p2p/rtorrent/files/patch-Fixed_RpcManager deleted file mode 100644 index 65a2f8498ef9..000000000000 --- a/net-p2p/rtorrent/files/patch-Fixed_RpcManager +++ /dev/null @@ -1,63 +0,0 @@ -commit 672bd0900501bba4d302479dc6fd1e244c2268f5 -Author: rakshasa -Date: Sat Mar 29 07:46:22 2025 +0100 - - Added default switch cases to RpcManager. - -diff --git src/rpc/rpc_manager.cc src/rpc/rpc_manager.cc -index 5409a4f..13a13d6 100644 ---- src/rpc/rpc_manager.cc -+++ src/rpc/rpc_manager.cc -@@ -99,22 +99,26 @@ RpcManager::object_to_target(const torrent::Object& obj, int call_flags, rpc::ta - bool - RpcManager::process(RPCType type, const char* in_buffer, uint32_t length, slot_response_callback callback) { - switch (type) { -- case RPCType::XML: { -+ case RPCType::XML: - if (m_xmlrpc.is_valid() && rpc::call_command_value("network.rpc.use_xmlrpc")) { - return m_xmlrpc.process(in_buffer, length, callback); - } else { - const std::string response = "faultCode-501faultStringXML-RPC not supported"; - return callback(response.c_str(), response.size()); - } -- } -- case RPCType::JSON: { -+ break; -+ -+ case RPCType::JSON: - if (rpc::call_command_value("network.rpc.use_jsonrpc")) { - return m_jsonrpc.process(in_buffer, length, callback); - } else { - const std::string response = "{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32601,\"message\":\"JSON-RPC not supported\"},\"id\":null}"; - return callback(response.c_str(), response.size()); - } -- } -+ break; -+ -+ default: -+ throw torrent::input_error("invalid parameters: unknown RPC type"); - } - } - -@@ -139,6 +143,8 @@ RpcManager::is_type_enabled(RPCType type) const { - return m_is_xmlrpc_enabled; - case RPCType::JSON: - return m_is_jsonrpc_enabled; -+ default: -+ throw torrent::input_error("invalid parameters: unknown RPC type"); - } - } - -@@ -147,8 +153,12 @@ RpcManager::set_type_enabled(RPCType type, bool enabled) { - switch (type) { - case RPCType::XML: - m_is_xmlrpc_enabled = enabled; -+ break; - case RPCType::JSON: - m_is_jsonrpc_enabled = enabled; -+ break; -+ default: -+ throw torrent::input_error("invalid parameters: unknown RPC type"); - } - } - diff --git a/net-p2p/rtorrent/files/patch-configure b/net-p2p/rtorrent/files/patch-configure deleted file mode 100644 index 8953b1567937..000000000000 --- a/net-p2p/rtorrent/files/patch-configure +++ /dev/null @@ -1,15 +0,0 @@ -Fixed configure script compatibility issue. -Applied manually on configure from 92e37cb4d7760bd4a1e6cd07eb61d33f4c402647 - - ---- configure.orig 2025-03-28 23:35:13 UTC -+++ configure -@@ -17588,7 +17588,7 @@ printf "%s\n" "#define API_VERSION 11" >>confdefs.h - CXX="$CXX" - else - result=`echo "${values_to_check}" | $GREP -Fvx -- "${unwanted_values}" | $GREP -v '^$'` -- CXX=${result//$'\n'/ } -+ CXX=$(echo "$result" | tr -d '\n') - fi - -