Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rtorrent for openSUSE:Factory checked in at 2026-09-17 15:20:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rtorrent (Old) and /work/SRC/openSUSE:Factory/.rtorrent.new.383539 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rtorrent" Thu Sep 17 15:20:54 2026 rev:41 rq:1378377 version:0.16.23 Changes: -------- --- /work/SRC/openSUSE:Factory/rtorrent/rtorrent.changes 2026-09-04 12:42:16.618518156 +0200 +++ /work/SRC/openSUSE:Factory/.rtorrent.new.383539/rtorrent.changes 2026-09-17 15:22:47.599468911 +0200 @@ -1,0 +2,9 @@ +Wed Sep 16 12:52:59 UTC 2026 - Jan Engelhardt <[email protected]> + +- Update to release 0.16.23 + * This release includes various bugfixes and minor improvements + as part of a stable series of releases. + * New bind address syntax (via libtorrent): Adding device name + to bind addresses is now supported, e.g. `fe80::1%eth0`. + +------------------------------------------------------------------- Old: ---- rtorrent-0.16.22.tar.gz New: ---- rtorrent-0.16.23.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rtorrent.spec ++++++ --- /var/tmp/diff_new_pack.b8JnpM/_old 2026-09-17 15:22:49.223536954 +0200 +++ /var/tmp/diff_new_pack.b8JnpM/_new 2026-09-17 15:22:49.227537122 +0200 @@ -17,7 +17,7 @@ Name: rtorrent -Version: 0.16.22 +Version: 0.16.23 Release: 0 Summary: Console-based BitTorrent client License: SUSE-GPL-2.0+-with-openssl-exception ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.b8JnpM/_old 2026-09-17 15:22:49.314540767 +0200 +++ /var/tmp/diff_new_pack.b8JnpM/_new 2026-09-17 15:22:49.322541102 +0200 @@ -1,5 +1,5 @@ -mtime: 1788432728 -commit: ac4b3d50b3755e209866122a7814a4414c2ae92f336e0eb270b9801f006d06c3 +mtime: 1789563289 +commit: 01645d89446b5eb38b5ae9a4d4c5d2d80e35c5c6b4db8ed2439e4f3e93cb8b9e url: https://src.opensuse.org/jengelh/rtorrent revision: master ++++++ build.specials.obscpio ++++++ ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-09-16 14:54:49.000000000 +0200 @@ -0,0 +1 @@ +.osc ++++++ rtorrent-0.16.22.tar.gz -> rtorrent-0.16.23.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rtorrent-0.16.22/configure new/rtorrent-0.16.23/configure --- old/rtorrent-0.16.22/configure 2026-09-02 10:40:38.000000000 +0200 +++ new/rtorrent-0.16.23/configure 2026-09-15 15:28:12.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for rtorrent 0.16.22. +# Generated by GNU Autoconf 2.72 for rtorrent 0.16.23. # # Report bugs to <[email protected]>. # @@ -614,8 +614,8 @@ # Identity of this package. PACKAGE_NAME='rtorrent' PACKAGE_TARNAME='rtorrent' -PACKAGE_VERSION='0.16.22' -PACKAGE_STRING='rtorrent 0.16.22' +PACKAGE_VERSION='0.16.23' +PACKAGE_STRING='rtorrent 0.16.23' PACKAGE_BUGREPORT='[email protected]' PACKAGE_URL='' @@ -1422,7 +1422,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -'configure' configures rtorrent 0.16.22 to adapt to many kinds of systems. +'configure' configures rtorrent 0.16.23 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1493,7 +1493,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of rtorrent 0.16.22:";; + short | recursive ) echo "Configuration of rtorrent 0.16.23:";; esac cat <<\_ACEOF @@ -1645,7 +1645,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -rtorrent configure 0.16.22 +rtorrent configure 0.16.23 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. @@ -2274,7 +2274,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by rtorrent $as_me 0.16.22, which was +It was created by rtorrent $as_me 0.16.23, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -3967,7 +3967,7 @@ # Define the identity of the package. PACKAGE='rtorrent' - VERSION='0.16.22' + VERSION='0.16.23' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -18709,7 +18709,7 @@ fi -printf "%s\n" "#define API_VERSION 26" >>confdefs.h +printf "%s\n" "#define API_VERSION 27" >>confdefs.h @@ -21574,19 +21574,19 @@ fi pkg_failed=no -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libtorrent >= 0.16.22" >&5 -printf %s "checking for libtorrent >= 0.16.22... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libtorrent >= 0.16.23" >&5 +printf %s "checking for libtorrent >= 0.16.23... " >&6; } if test -n "$DEPENDENCIES_CFLAGS"; then pkg_cv_DEPENDENCIES_CFLAGS="$DEPENDENCIES_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent >= 0.16.22\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libtorrent >= 0.16.22") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent >= 0.16.23\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libtorrent >= 0.16.23") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_DEPENDENCIES_CFLAGS=`$PKG_CONFIG --cflags "libtorrent >= 0.16.22" 2>/dev/null` + pkg_cv_DEPENDENCIES_CFLAGS=`$PKG_CONFIG --cflags "libtorrent >= 0.16.23" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -21598,12 +21598,12 @@ pkg_cv_DEPENDENCIES_LIBS="$DEPENDENCIES_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent >= 0.16.22\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libtorrent >= 0.16.22") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent >= 0.16.23\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libtorrent >= 0.16.23") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_DEPENDENCIES_LIBS=`$PKG_CONFIG --libs "libtorrent >= 0.16.22" 2>/dev/null` + pkg_cv_DEPENDENCIES_LIBS=`$PKG_CONFIG --libs "libtorrent >= 0.16.23" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -21624,14 +21624,14 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - DEPENDENCIES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libtorrent >= 0.16.22" 2>&1` + DEPENDENCIES_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libtorrent >= 0.16.23" 2>&1` else - DEPENDENCIES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libtorrent >= 0.16.22" 2>&1` + DEPENDENCIES_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libtorrent >= 0.16.23" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DEPENDENCIES_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (libtorrent >= 0.16.22) were not met: + as_fn_error $? "Package requirements (libtorrent >= 0.16.23) were not met: $DEPENDENCIES_PKG_ERRORS @@ -23631,7 +23631,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by rtorrent $as_me 0.16.22, which was +This file was extended by rtorrent $as_me 0.16.23, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -23699,7 +23699,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -rtorrent config.status 0.16.22 +rtorrent config.status 0.16.23 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rtorrent-0.16.22/configure.ac new/rtorrent-0.16.23/configure.ac --- old/rtorrent-0.16.22/configure.ac 2026-09-02 10:22:23.000000000 +0200 +++ new/rtorrent-0.16.23/configure.ac 2026-09-15 15:09:39.000000000 +0200 @@ -1,6 +1,6 @@ m4_pattern_allow([PKG_CHECK_EXISTS]) -AC_INIT([rtorrent],[0.16.22],[[email protected]]) +AC_INIT([rtorrent],[0.16.23],[[email protected]]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIRS([scripts]) @@ -14,7 +14,7 @@ PKG_PROG_PKG_CONFIG -AC_DEFINE([API_VERSION], [26], [api version]) +AC_DEFINE([API_VERSION], [27], [api version]) RAK_CHECK_CFLAGS RAK_CHECK_CXXFLAGS @@ -49,7 +49,7 @@ PKG_CHECK_MODULES([CPPUNIT], [cppunit],, [no_cppunit="yes"]) PKG_CHECK_MODULES([ZLIB], [zlib]) -PKG_CHECK_MODULES([DEPENDENCIES], [libtorrent >= 0.16.22]) +PKG_CHECK_MODULES([DEPENDENCIES], [libtorrent >= 0.16.23]) AC_LANG_PUSH(C++) TORRENT_WITH_XMLRPC_C diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rtorrent-0.16.22/src/command_ip.cc new/rtorrent-0.16.23/src/command_ip.cc --- old/rtorrent-0.16.22/src/command_ip.cc 2026-09-02 10:22:23.000000000 +0200 +++ new/rtorrent-0.16.23/src/command_ip.cc 2026-09-15 15:09:39.000000000 +0200 @@ -131,7 +131,7 @@ // copy everything up to '#' to address_copy and work from there while(address[address_start_index] != '#' && address[address_start_index] != '\r' && address[address_start_index] != '\n' && address[address_start_index] != '\0' && - address_start_index < 4096 ) { + address_start_index < 4095 ) { address_copy[address_start_index] = address[address_start_index]; address_start_index++; @@ -206,6 +206,9 @@ if (mask_bits == 0) { mask = 0; end_mask = ~(uint32_t)0; + } else if (mask_bits == 32) { + mask = ~(uint32_t)0; + end_mask = 0; } else { mask = (~mask) << (32-mask_bits); end_mask = (~end_mask) >> mask_bits; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rtorrent-0.16.22/src/core/download_factory.cc new/rtorrent-0.16.23/src/core/download_factory.cc --- old/rtorrent-0.16.22/src/core/download_factory.cc 2026-09-02 10:22:23.000000000 +0200 +++ new/rtorrent-0.16.23/src/core/download_factory.cc 2026-09-15 15:09:39.000000000 +0200 @@ -7,6 +7,7 @@ #include <functional> #include <sstream> #include <stdexcept> +#include <sys/stat.h> #include <torrent/utils/log.h> #include <torrent/utils/resume.h> #include <torrent/object.h> @@ -39,6 +40,11 @@ static std::unique_ptr<torrent::Object> download_factory_load_stream(const char* filename, bool* is_invalid) { + struct stat sb; + + if (stat(filename, &sb) != 0 || !S_ISREG(sb.st_mode)) + return std::unique_ptr<torrent::Object>(); + std::fstream stream(filename, std::ios::in | std::ios::binary); if (!stream.is_open()) @@ -167,11 +173,19 @@ DownloadFactory::receive_success() { bool session_invalid = false; - auto rtorrent_object = download_factory_load_stream((expand_path(m_uri) + ".rtorrent").c_str(), &session_invalid); - auto libtorrent_resume_object = download_factory_load_stream((expand_path(m_uri) + ".libtorrent_resume").c_str(), &session_invalid); + std::unique_ptr<torrent::Object> rtorrent_object; + std::unique_ptr<torrent::Object> libtorrent_resume_object; - if (session_invalid) - lt_log_print(torrent::LOG_ERROR, "%s: %s", session_invalid_message, m_uri.c_str()); + if (m_session) { + if (m_uri.empty()) + throw torrent::input_error("Session torrent URI is empty."); + + rtorrent_object = download_factory_load_stream((expand_path(m_uri) + ".rtorrent").c_str(), &session_invalid); + libtorrent_resume_object = download_factory_load_stream((expand_path(m_uri) + ".libtorrent_resume").c_str(), &session_invalid); + + if (session_invalid) + lt_log_print(torrent::LOG_ERROR, "%s: %s", session_invalid_message, m_uri.c_str()); + } uint32_t tracker_key; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rtorrent-0.16.22/src/rpc/scgi_task.h new/rtorrent-0.16.23/src/rpc/scgi_task.h --- old/rtorrent-0.16.22/src/rpc/scgi_task.h 2026-09-02 10:22:23.000000000 +0200 +++ new/rtorrent-0.16.23/src/rpc/scgi_task.h 2026-09-15 15:09:39.000000000 +0200 @@ -16,7 +16,7 @@ public: static constexpr int default_buffer_size = 8191; static constexpr int max_header_size = 2000; - static constexpr int max_content_size = (2 << 23); + static constexpr int max_content_size = (1 << 26); static constexpr auto timeout_request = std::chrono::seconds(60); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rtorrent-0.16.22/src/rpc/xmlrpc_c.cc new/rtorrent-0.16.23/src/rpc/xmlrpc_c.cc --- old/rtorrent-0.16.22/src/rpc/xmlrpc_c.cc 2026-09-02 10:22:23.000000000 +0200 +++ new/rtorrent-0.16.23/src/rpc/xmlrpc_c.cc 2026-09-15 15:09:39.000000000 +0200 @@ -77,16 +77,18 @@ { const char* str; xmlrpc_read_string(env, tmp, &str); + xmlrpc_DECREF(tmp); if (env->fault_occurred) throw xmlrpc_error_c(env); const char* end = str; int64_t v3 = ::strtoll(str, (char**)&end, 0); + bool invalid = *str == '\0' || *end != '\0'; ::free((void*)str); - if (*str == '\0' || *end != '\0') + if (invalid) throw xmlrpc_error_c(XMLRPC_TYPE_ERROR, "Invalid index."); return v3; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rtorrent-0.16.22/src/session/download_storer.cc new/rtorrent-0.16.23/src/session/download_storer.cc --- old/rtorrent-0.16.22/src/session/download_storer.cc 2026-09-02 10:22:23.000000000 +0200 +++ new/rtorrent-0.16.23/src/session/download_storer.cc 2026-09-15 15:09:39.000000000 +0200 @@ -127,8 +127,12 @@ if (!output.good()) throw torrent::storage_error("failed to write stream to file : " + path); + // The data only reaches the kernel here, so this is where a full disk is seen. output.close(); + if (!output.good()) + throw torrent::storage_error("failed to flush stream to file : " + path); + // Ensure that the new file is actually written to the disk int fd = ::open(path.c_str(), O_WRONLY); @@ -137,13 +141,19 @@ if (use_fsyncdisk) { #ifdef __APPLE__ - ::fsync(fd); + int sync_result = ::fsync(fd); #else - ::fdatasync(fd); + int sync_result = ::fdatasync(fd); #endif + + if (sync_result == -1) { + ::close(fd); + throw torrent::storage_error("failed to sync file to disk : " + path); + } } - ::close(fd); + if (::close(fd) == -1) + throw torrent::storage_error("failed to close file descriptor : " + path); } } // namespace anonymous diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rtorrent-0.16.22/src/setup.h new/rtorrent-0.16.23/src/setup.h --- old/rtorrent-0.16.22/src/setup.h 2026-09-02 10:22:23.000000000 +0200 +++ new/rtorrent-0.16.23/src/setup.h 2026-09-15 15:09:39.000000000 +0200 @@ -3,6 +3,7 @@ #include <functional> #include <string> +#include <vector> int parse_main_options(int argc, char** argv); void parse_config_file(int argc, char** argv, std::function<void (const std::string&)> parse_fn); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rtorrent-0.16.22/src/utils/gzip.cc new/rtorrent-0.16.23/src/utils/gzip.cc --- old/rtorrent-0.16.22/src/utils/gzip.cc 2026-09-02 10:22:23.000000000 +0200 +++ new/rtorrent-0.16.23/src/utils/gzip.cc 2026-09-15 15:09:39.000000000 +0200 @@ -5,6 +5,8 @@ #include <zlib.h> #include <torrent/exceptions.h> +#include "utils/functional.h" + namespace utils { void @@ -21,6 +23,8 @@ if (deflateInit2(&zs, Z_DEFAULT_COMPRESSION, Z_DEFLATED, window_bits | gzip_encoding, gzip_level, Z_DEFAULT_STRATEGY) != Z_OK) throw torrent::internal_error("gzip_compress_to_vector(...) could not initialize gzip deflate."); + scope_guard guard([&zs]() { deflateEnd(&zs); }); + auto max_response_size = deflateBound(&zs, length); output.resize(offset + max_response_size); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rtorrent-0.16.22/test/Makefile.am new/rtorrent-0.16.23/test/Makefile.am --- old/rtorrent-0.16.22/test/Makefile.am 2026-09-02 10:22:23.000000000 +0200 +++ new/rtorrent-0.16.23/test/Makefile.am 2026-09-15 15:09:39.000000000 +0200 @@ -51,6 +51,8 @@ rtorrent_Test_Src_SOURCES = $(rtorrent_Test_Common) \ src/test_command_dynamic.cc \ src/test_command_dynamic.h \ + src/test_command_ip.cc \ + src/test_command_ip.h \ src/test_command_system.cc \ src/test_command_system.h \ src/test_command_path.cc \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rtorrent-0.16.22/test/Makefile.in new/rtorrent-0.16.23/test/Makefile.in --- old/rtorrent-0.16.22/test/Makefile.in 2026-09-02 10:40:39.000000000 +0200 +++ new/rtorrent-0.16.23/test/Makefile.in 2026-09-15 15:28:13.000000000 +0200 @@ -152,6 +152,7 @@ helpers/rtorrent_Test_Src-test_thread.$(OBJEXT) am_rtorrent_Test_Src_OBJECTS = $(am__objects_2) \ src/rtorrent_Test_Src-test_command_dynamic.$(OBJEXT) \ + src/rtorrent_Test_Src-test_command_ip.$(OBJEXT) \ src/rtorrent_Test_Src-test_command_system.$(OBJEXT) \ src/rtorrent_Test_Src-test_command_path.$(OBJEXT) \ src/rtorrent_Test_Src-test_command_string.$(OBJEXT) \ @@ -200,6 +201,7 @@ rpc/$(DEPDIR)/rtorrent_Test_Rpc-test_parse_options.Po \ rpc/$(DEPDIR)/rtorrent_Test_Rpc-test_xmlrpc.Po \ src/$(DEPDIR)/rtorrent_Test_Src-test_command_dynamic.Po \ + src/$(DEPDIR)/rtorrent_Test_Src-test_command_ip.Po \ src/$(DEPDIR)/rtorrent_Test_Src-test_command_path.Po \ src/$(DEPDIR)/rtorrent_Test_Src-test_command_string.Po \ src/$(DEPDIR)/rtorrent_Test_Src-test_command_system.Po \ @@ -686,6 +688,8 @@ rtorrent_Test_Src_SOURCES = $(rtorrent_Test_Common) \ src/test_command_dynamic.cc \ src/test_command_dynamic.h \ + src/test_command_ip.cc \ + src/test_command_ip.h \ src/test_command_system.cc \ src/test_command_system.h \ src/test_command_path.cc \ @@ -801,6 +805,8 @@ @: >>src/$(DEPDIR)/$(am__dirstamp) src/rtorrent_Test_Src-test_command_dynamic.$(OBJEXT): \ src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) +src/rtorrent_Test_Src-test_command_ip.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) src/rtorrent_Test_Src-test_command_system.$(OBJEXT): \ src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) src/rtorrent_Test_Src-test_command_path.$(OBJEXT): \ @@ -846,6 +852,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@rpc/$(DEPDIR)/rtorrent_Test_Rpc-test_parse_options.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@rpc/$(DEPDIR)/rtorrent_Test_Rpc-test_xmlrpc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/rtorrent_Test_Src-test_command_dynamic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/rtorrent_Test_Src-test_command_ip.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/rtorrent_Test_Src-test_command_path.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/rtorrent_Test_Src-test_command_string.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/rtorrent_Test_Src-test_command_system.Po@am__quote@ # am--include-marker @@ -1203,6 +1210,20 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtorrent_Test_Src_CXXFLAGS) $(CXXFLAGS) -c -o src/rtorrent_Test_Src-test_command_dynamic.obj `if test -f 'src/test_command_dynamic.cc'; then $(CYGPATH_W) 'src/test_command_dynamic.cc'; else $(CYGPATH_W) '$(srcdir)/src/test_command_dynamic.cc'; fi` +src/rtorrent_Test_Src-test_command_ip.o: src/test_command_ip.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtorrent_Test_Src_CXXFLAGS) $(CXXFLAGS) -MT src/rtorrent_Test_Src-test_command_ip.o -MD -MP -MF src/$(DEPDIR)/rtorrent_Test_Src-test_command_ip.Tpo -c -o src/rtorrent_Test_Src-test_command_ip.o `test -f 'src/test_command_ip.cc' || echo '$(srcdir)/'`src/test_command_ip.cc +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/rtorrent_Test_Src-test_command_ip.Tpo src/$(DEPDIR)/rtorrent_Test_Src-test_command_ip.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/test_command_ip.cc' object='src/rtorrent_Test_Src-test_command_ip.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtorrent_Test_Src_CXXFLAGS) $(CXXFLAGS) -c -o src/rtorrent_Test_Src-test_command_ip.o `test -f 'src/test_command_ip.cc' || echo '$(srcdir)/'`src/test_command_ip.cc + +src/rtorrent_Test_Src-test_command_ip.obj: src/test_command_ip.cc +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtorrent_Test_Src_CXXFLAGS) $(CXXFLAGS) -MT src/rtorrent_Test_Src-test_command_ip.obj -MD -MP -MF src/$(DEPDIR)/rtorrent_Test_Src-test_command_ip.Tpo -c -o src/rtorrent_Test_Src-test_command_ip.obj `if test -f 'src/test_command_ip.cc'; then $(CYGPATH_W) 'src/test_command_ip.cc'; else $(CYGPATH_W) '$(srcdir)/src/test_command_ip.cc'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/rtorrent_Test_Src-test_command_ip.Tpo src/$(DEPDIR)/rtorrent_Test_Src-test_command_ip.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/test_command_ip.cc' object='src/rtorrent_Test_Src-test_command_ip.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtorrent_Test_Src_CXXFLAGS) $(CXXFLAGS) -c -o src/rtorrent_Test_Src-test_command_ip.obj `if test -f 'src/test_command_ip.cc'; then $(CYGPATH_W) 'src/test_command_ip.cc'; else $(CYGPATH_W) '$(srcdir)/src/test_command_ip.cc'; fi` + src/rtorrent_Test_Src-test_command_system.o: src/test_command_system.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rtorrent_Test_Src_CXXFLAGS) $(CXXFLAGS) -MT src/rtorrent_Test_Src-test_command_system.o -MD -MP -MF src/$(DEPDIR)/rtorrent_Test_Src-test_command_system.Tpo -c -o src/rtorrent_Test_Src-test_command_system.o `test -f 'src/test_command_system.cc' || echo '$(srcdir)/'`src/test_command_system.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/rtorrent_Test_Src-test_command_system.Tpo src/$(DEPDIR)/rtorrent_Test_Src-test_command_system.Po @@ -1618,6 +1639,7 @@ -rm -f rpc/$(DEPDIR)/rtorrent_Test_Rpc-test_parse_options.Po -rm -f rpc/$(DEPDIR)/rtorrent_Test_Rpc-test_xmlrpc.Po -rm -f src/$(DEPDIR)/rtorrent_Test_Src-test_command_dynamic.Po + -rm -f src/$(DEPDIR)/rtorrent_Test_Src-test_command_ip.Po -rm -f src/$(DEPDIR)/rtorrent_Test_Src-test_command_path.Po -rm -f src/$(DEPDIR)/rtorrent_Test_Src-test_command_string.Po -rm -f src/$(DEPDIR)/rtorrent_Test_Src-test_command_system.Po @@ -1690,6 +1712,7 @@ -rm -f rpc/$(DEPDIR)/rtorrent_Test_Rpc-test_parse_options.Po -rm -f rpc/$(DEPDIR)/rtorrent_Test_Rpc-test_xmlrpc.Po -rm -f src/$(DEPDIR)/rtorrent_Test_Src-test_command_dynamic.Po + -rm -f src/$(DEPDIR)/rtorrent_Test_Src-test_command_ip.Po -rm -f src/$(DEPDIR)/rtorrent_Test_Src-test_command_path.Po -rm -f src/$(DEPDIR)/rtorrent_Test_Src-test_command_string.Po -rm -f src/$(DEPDIR)/rtorrent_Test_Src-test_command_system.Po diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rtorrent-0.16.22/test/src/test_command_ip.cc new/rtorrent-0.16.23/test/src/test_command_ip.cc --- old/rtorrent-0.16.22/test/src/test_command_ip.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/rtorrent-0.16.23/test/src/test_command_ip.cc 2026-09-15 15:09:39.000000000 +0200 @@ -0,0 +1,55 @@ +#include "config.h" + +#include "test/src/test_command_ip.h" + +#include <cstdint> + +CPPUNIT_TEST_SUITE_REGISTRATION(TestCommandIp); + +bool ipv4_range_parse(const char* address, uint32_t* address_start, uint32_t* address_end); + +static uint32_t +ipv4(uint32_t a, uint32_t b, uint32_t c, uint32_t d) { + return (a << 24) | (b << 16) | (c << 8) | d; +} + +#define RANGE_ASSERT(address, expected_start, expected_end) \ + { \ + uint32_t start = 0; \ + uint32_t end = 0; \ + \ + CPPUNIT_ASSERT(ipv4_range_parse(address, &start, &end)); \ + CPPUNIT_ASSERT_EQUAL(expected_start, start); \ + CPPUNIT_ASSERT_EQUAL(expected_end, end); \ + } + +void +TestCommandIp::test_single_address() { + RANGE_ASSERT("10.1.2.3", ipv4(10, 1, 2, 3), ipv4(10, 1, 2, 3)); +} + +void +TestCommandIp::test_explicit_range() { + RANGE_ASSERT("10.1.2.3-10.1.2.9", ipv4(10, 1, 2, 3), ipv4(10, 1, 2, 9)); +} + +void +TestCommandIp::test_cidr() { + RANGE_ASSERT("10.0.0.0/8", ipv4(10, 0, 0, 0), ipv4(10, 255, 255, 255)); + RANGE_ASSERT("10.1.2.0/24", ipv4(10, 1, 2, 0), ipv4(10, 1, 2, 255)); + RANGE_ASSERT("10.1.2.128/25", ipv4(10, 1, 2, 128), ipv4(10, 1, 2, 255)); + RANGE_ASSERT("10.1.2.3/31", ipv4(10, 1, 2, 2), ipv4(10, 1, 2, 3)); +} + +void +TestCommandIp::test_cidr_zero_mask() { + RANGE_ASSERT("0.0.0.0/0", ipv4(0, 0, 0, 0), ipv4(255, 255, 255, 255)); + RANGE_ASSERT("10.1.2.3/0", ipv4(0, 0, 0, 0), ipv4(255, 255, 255, 255)); +} + +void +TestCommandIp::test_cidr_full_mask() { + RANGE_ASSERT("10.1.2.3/32", ipv4(10, 1, 2, 3), ipv4(10, 1, 2, 3)); + RANGE_ASSERT("0.0.0.0/32", ipv4(0, 0, 0, 0), ipv4(0, 0, 0, 0)); + RANGE_ASSERT("255.255.255.255/32", ipv4(255, 255, 255, 255), ipv4(255, 255, 255, 255)); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rtorrent-0.16.22/test/src/test_command_ip.h new/rtorrent-0.16.23/test/src/test_command_ip.h --- old/rtorrent-0.16.22/test/src/test_command_ip.h 1970-01-01 01:00:00.000000000 +0100 +++ new/rtorrent-0.16.23/test/src/test_command_ip.h 2026-09-15 15:09:39.000000000 +0200 @@ -0,0 +1,25 @@ +#include <cppunit/TestFixture.h> +#include <cppunit/extensions/HelperMacros.h> + +// ipv4_range_parse is a pure function, so this does not use test_fixture and +// the mock and logging setup that comes with it. +class TestCommandIp : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(TestCommandIp); + + CPPUNIT_TEST(test_single_address); + CPPUNIT_TEST(test_explicit_range); + + CPPUNIT_TEST(test_cidr); + CPPUNIT_TEST(test_cidr_zero_mask); + CPPUNIT_TEST(test_cidr_full_mask); + + CPPUNIT_TEST_SUITE_END(); + +public: + void test_single_address(); + void test_explicit_range(); + + void test_cidr(); + void test_cidr_zero_mask(); + void test_cidr_full_mask(); +};
