From dda5e4fa04b6902bbcbe7f264a3131482d0455d9 Mon Sep 17 00:00:00 2001 From: Maks Verver Date: Mon, 3 Aug 2026 14:19:40 +0200 Subject: [PATCH 1/4] Fix deprecated command redirects (rtorrent -D) --- src/main.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.cc b/src/main.cc index f526d458..87683667 100644 --- a/src/main.cc +++ b/src/main.cc @@ -392,13 +392,12 @@ main(int argc, char** argv) { CMD_REDIRECT("bind", "network.bind_address.set"); CMD_REDIRECT("ip", "network.local_address.set"); - CMD_REDIRECT("port_range", "network.port_range.set"); // TODO: Check if dht is on by default. CMD_REDIRECT("dht", "dht.mode.set"); - CMD_REDIRECT("port_random", "network.port_random.set"); - CMD_REDIRECT("proxy_address", "network.proxy_address.set"); + CMD_REDIRECT("port_random", "network.listen.port.random.set"); + CMD_REDIRECT("proxy_address", "network.proxy.http.set"); CMD_REDIRECT("key_layout", "keys.layout.set"); From d20c3234da876bc1ac6f39e68197cba26f4047fb Mon Sep 17 00:00:00 2001 From: xirvik Date: Tue, 4 Aug 2026 16:36:29 +0000 Subject: [PATCH 2/4] Add system.sockets allocation budget commands. They report the budget the socket manager enforces, so a client can show the limit. --- src/command_local.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/command_local.cc b/src/command_local.cc index 269a6e9b..d1c44d87 100644 --- a/src/command_local.cc +++ b/src/command_local.cc @@ -243,6 +243,8 @@ initialize_command_local() { CMD_ANY ("system.sockets.max_size", [](auto, auto) { return torrent::runtime::socket_manager()->max_size(); }); CMD_ANY_VALUE_V ("system.sockets.max_size.set", [](auto, auto& value) { return torrent::runtime::socket_manager()->set_max_size_and_adjust(value); }); CMD_ANY_V ("system.sockets.adjust_alloc", [](auto, auto) { torrent::runtime::socket_manager()->adjust_allocation(); }); + CMD_ANY ("system.sockets.reserved_alloc", [](auto, auto) { return torrent::runtime::socket_manager()->reserved_allocation(); }); + CMD_ANY ("system.sockets.available_alloc", [](auto, auto) { return torrent::runtime::socket_manager()->available_allocation(); }); for (uint32_t i = 0; i < torrent::runtime::SocketManager::category_count; ++i) { auto category = static_cast(i); @@ -251,8 +253,10 @@ initialize_command_local() { CMD_ANY (category_name + ".size", [category](auto, auto) { return torrent::runtime::socket_manager()->category_managed_size(category); }); CMD_ANY (category_name + ".max_size", [category](auto, auto) { return torrent::runtime::socket_manager()->category_max_size(category); }); - if (i == 0) + if (i == 0) { + CMD_ANY (category_name + ".min_alloc", [](auto, auto) { return torrent::runtime::socket_manager()->generic_min_allocation(); }); continue; + } CMD_ANY (category_name + ".min_alloc", [category](auto, auto) { return torrent::runtime::socket_manager()->category_min_allocation(category); }); CMD_ANY (category_name + ".max_alloc", [category](auto, auto) { return torrent::runtime::socket_manager()->category_max_allocation(category); }); @@ -348,6 +352,8 @@ initialize_command_local() { rpc::rpc.mark_safe("system.sockets.size"); rpc::rpc.mark_safe("system.sockets.max_size"); + rpc::rpc.mark_safe("system.sockets.reserved_alloc"); + rpc::rpc.mark_safe("system.sockets.available_alloc"); for (uint32_t i = 0; i < torrent::runtime::SocketManager::category_count; ++i) { auto category_name = "system.sockets." + torrent::option_to_str_or_throw(torrent::OPTION_SOCKET_CATEGORY, i); @@ -355,8 +361,10 @@ initialize_command_local() { rpc::rpc.mark_safe(category_name + ".size"); rpc::rpc.mark_safe(category_name + ".max_size"); - if (i == 0) + if (i == 0) { + rpc::rpc.mark_safe(category_name + ".min_alloc"); continue; + } rpc::rpc.mark_safe(category_name + ".min_alloc"); rpc::rpc.mark_safe(category_name + ".max_alloc"); From e56bffff4d7fc3f93c4385e59649a5e82d58be4b Mon Sep 17 00:00:00 2001 From: rakshasa Date: Wed, 5 Aug 2026 10:50:05 +0200 Subject: [PATCH 3/4] Fixed socket category unit test. --- test/src/test_command_local.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/src/test_command_local.cc b/test/src/test_command_local.cc index 46b15e21..bde49046 100644 --- a/test/src/test_command_local.cc +++ b/test/src/test_command_local.cc @@ -45,8 +45,8 @@ TestCommandLocal::test_socket_category_commands() { CPPUNIT_ASSERT(rpc::commands.has(name + ".size")); CPPUNIT_ASSERT(rpc::commands.has(name + ".max_size")); + CPPUNIT_ASSERT(rpc::commands.has(name + ".min_alloc")); - CPPUNIT_ASSERT_EQUAL(has_allocation, rpc::commands.has(name + ".min_alloc")); CPPUNIT_ASSERT_EQUAL(has_allocation, rpc::commands.has(name + ".max_alloc")); CPPUNIT_ASSERT_EQUAL(has_allocation, rpc::commands.has(name + ".min_alloc.set")); CPPUNIT_ASSERT_EQUAL(has_allocation, rpc::commands.has(name + ".max_alloc.set")); From dd3ddf7c391ada92e4ba86fb6afd8a6cc01446b8 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Thu, 6 Aug 2026 10:11:01 +0200 Subject: [PATCH 4/4] Tagged release 0.16.20. --- .github/workflows/commit-lint.yml | 2 +- configure.ac | 6 +++--- src/utils/waitpid_queue.h | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index be17d8d1..6e060262 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -39,7 +39,7 @@ jobs: # 2. Check for multiple consecutive blank lines # This regex looks for 2 or more empty lines anywhere in the message - if echo "$CLEAN_MSG" | grep -pz '(\r?\n){3,}'; then + if echo "$CLEAN_MSG" | grep -Pz '(\r?\n){3,}'; then echo "❌ Error: Commit message contains multiple consecutive line breaks." echo " Commit: '$SUBJECT'" FAILED=1 diff --git a/configure.ac b/configure.ac index 490f3154..e4d7d2b0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ m4_pattern_allow([PKG_CHECK_EXISTS]) -AC_INIT([rtorrent],[0.16.19],[sundell.software@gmail.com]) +AC_INIT([rtorrent],[0.16.20],[sundell.software@gmail.com]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIRS([scripts]) @@ -14,7 +14,7 @@ AX_CXX_COMPILE_STDCXX(20, noext, mandatory) PKG_PROG_PKG_CONFIG -AC_DEFINE([API_VERSION], [24], [api version]) +AC_DEFINE([API_VERSION], [25], [api version]) RAK_CHECK_CFLAGS RAK_CHECK_CXXFLAGS @@ -47,7 +47,7 @@ fi PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit="yes"]) PKG_CHECK_MODULES([ZLIB], [zlib]) -PKG_CHECK_MODULES([DEPENDENCIES], [libtorrent >= 0.16.19]) +PKG_CHECK_MODULES([DEPENDENCIES], [libtorrent >= 0.16.20]) AC_LANG_PUSH(C++) TORRENT_WITH_XMLRPC_C diff --git a/src/utils/waitpid_queue.h b/src/utils/waitpid_queue.h index a441e4cc..f4d0e22a 100644 --- a/src/utils/waitpid_queue.h +++ b/src/utils/waitpid_queue.h @@ -18,6 +18,8 @@ public: void wait_for(uint32_t max_remaining); + // TODO: Add a signal handler to tell the worker thread to wake up. Use a counter to batch wakeups. + private: WaitpidQueue(const WaitpidQueue&) = delete; WaitpidQueue& operator=(const WaitpidQueue&) = delete;