Commit Graph

16632 Commits

Author SHA1 Message Date
Charles Kerr
a7b2a72cca refactor: remove tr_pathbuf::popdir() (#8221) 2026-01-25 20:02:59 -06:00
Yat Ho
daf15c01c3 build: improve building with system dht (#8192) 2026-01-25 19:12:58 -06:00
Charles Kerr
03fdb6f48e refactor: migrate C strings to std::string_view in libtransmission/file.h (#8220)
* refactor: tr_sys_file_open() now takes a std::string_view arg

* refactor: tr_sys_path_copy() now takes a std::string_view arg

* refactor: tr_blocklistSetContent() now takes a std::string_view arg

* refactor: tr_sys_path_remove() now takes a std::string_view arg

* refactor: tr_sys_path_exists() now takes a std::string_view arg

* refactor: tr_sys_dir_create() now takes a std::string_view arg

* refactor: add private stat_sv(), lstat_sv() helpers in file-posix.cc

* refactor: tr_sys_path_is_same() now takes a std::string_view arg

* refactor: tr_sys_path_rename() now takes a std::string_view arg
2026-01-25 18:39:50 -06:00
Yat Ho
4a900b10e7 build: improve building with system psl (#8193) 2026-01-25 12:11:57 -06:00
Yat Ho
0845c44c14 build: improve building with system libnatpmp (#8189) 2026-01-25 12:11:31 -06:00
Mitch Livingston
2d75dea939 fix: Hide Status Bar/Filter Bar never changing to "Show" (#8216) (#8070) 2026-01-24 17:12:52 -06:00
Yat Ho
3636f5f35e fix: modernize-use-designated-initializers in core and tests (#8186)
* fix(core): `modernize-use-designated-initializers`

* fix(tests): `modernize-use-designated-initializers`
2026-01-23 21:50:08 -06:00
Yat Ho
56f3578ec9 fix: don't generate zero size files in makemeta-test.cc (#8199)
* fix: don't generate zero size files in makemeta-test.cc

* chore: housekeeping
2026-01-23 21:48:56 -06:00
Yat Ho
b617dea8ad build: improve building with system libdeflate (#8188) 2026-01-23 11:05:03 -06:00
Yat Ho
665f689e44 build: support building with system {fmt} (#8187) 2026-01-23 11:04:16 -06:00
Yat Ho
9cee1d3d3b build: improve building with system libb64 (#8195) 2026-01-23 11:02:41 -06:00
Charles Kerr
cccef8e2a6 refactor: use fewer raw C strings (#8202)
* refactor: tr_ctorGetDownloadDir() returns a std::optional<std::string>

* refactor: tr_sessionGetConfigDir() now returns a std::string

* refactor: tr_sessionGetDownloadDir() now returns a std::string

* refactor: tr_sessionGetIncompleteDir() now returns a std::string

* refactor: tr_sessionGetRPCWhitelist() now returns a std::string

* refactor: tr_sessionGetRPCPassword() now returns a std::string

* refactor: tr_sessionGetRPCUsername() now returns a std::string

* refactor: tr_sessionGetScript() now returns a std::string

* refactor: tr_blocklistGetURL() now returns a std::string

* refactor: tr_ctorGetSourceFile() now returns a std::optional<std::string>

* refactor: tr_torrentFile() now returns a std::string
2026-01-22 22:36:24 -06:00
Charles Kerr
e7129cfd54 refactor: use fewer raw C strings (#8201)
* refactor: tr_blocklistSetURL() takes a string_view

* refactor: tr_ctorSetMetainfoFromFile() takes a string_view

* refactor: tr_ctorSetMetainfoFromMagnetLink() takes a string_view

* refactor: tr_torrentSetDownloadDir() takes a string_view

* refactor: tr_ctorSetDownloadDir() takes a string_view

* refactor: tr_ctorSetIncompleteDir() takes a string_view

* refactor: tr_torrentSetTrackerList() takes a string_view

* refactor: tr_torrentRenamePath() now takes a std::string_view

* refactor: tr_torrentFindFromMagnetLink() takes a string_view
2026-01-22 16:31:08 -06:00
Charles Kerr
f6e9027da7 refactor: use fewer raw C strings (#8200)
* refactor: tr_sessionSaveSettings() takes a string_view

* refactor: tr_sessionSetDownloadDir() takes a string_view

* refactor: tr_sessionSetIncompleteDir() takes a string_view

* refactor: tr_sessionSetRPCCWhitelist() takes a string_view

* refactor: tr_sessionSetRPCPassword() takes a string_view

* refactor: tr_sessionSetRPCUsername() takes a string_view

* refactor: tr_sessionSetDefaultTrackers() takes a string_view

* refactor: tr_sessionSetScript() takes a string_view
2026-01-22 14:38:20 -06:00
Yat Ho
f319bc6bf6 ci: update and test more Debian versions (#8153) 2026-01-22 09:06:41 -06:00
Yat Ho
16ec031a28 build: infrastructure for third party submodules (#8178) 2026-01-21 23:38:34 -06:00
Charles Kerr
87511c7123 test: add Session tests (#8185)
* build: disable some clang-tidy checks

we cannot use ranges while still supporting gcc 8

* refactor: add Prefs::keyval()

refactor: remove Prefs::getKey()

test: add Prefs::keyval() tests

* refactor: add Prefs::set(idx, tr_variant)

refactor: remove Prefs::type(idx)

refactor: remove Prefs::variant(idx)

* refactor: create RpcClient in main()

* test: add qt remote session tests
2026-01-21 22:36:41 -06:00
Charles Kerr
46005038e6 refactor: tr_torrentGetCurrentDir() returns a std::string_view (#8173)
* refactor: gtr_open_file() now takes a std::string_view

refactor: gtr_open_file() now calls Glib::filename_to_uri()

refactor: add gtr_open_file() variant that takes basedir and relative path

refactor: gtr_open_uri() now takes a relative_path std::string_view

* refactor: tr_torrentGetCurrentDir() now returns a std::string_view

refactor: tr_torrentGetDownloadDir() now returns a std::string_view
2026-01-21 11:40:16 -06:00
Yat Ho
35599a2d14 ci: bump to peter-evans/create-pull-request@v8 (#8177) 2026-01-21 11:06:54 -06:00
Yat Ho
6327cc6c2e build: add USE_SYSTEM_DEFAULT option (#8176)
* build: add `USE_SYSTEM_DEFAULT` option

* ci: use `USE_SYSTEM_DEFAULT`
2026-01-21 09:08:04 -06:00
Charles Kerr
7f5730984a refactor: add tr_strv_to_utf8_nsstring() (#8174)
* refactor: rename enum types in ip-cache private enum class is_updating_t

this avoids name collisions with YES and NO on macOS

* refactor: rename tr_strv_convert_utf8() to tr_strv_to_utf8_string()

use a name that is symmetrical with the upcoming tr_strv_to_utf8_nsstring()

* feat: add tr_strv_to_utf8_nsstring()

* test: add tests for the new tr_strv_to_utf8_nsstring() methods
2026-01-21 08:25:07 -06:00
Charles Kerr
83d49b3c7f ci: add run-tests composite action (#8159)
* ci: add run-tests composite action

* fixup! ci: add run-tests composite action

send sanitizer log messages to stderr

otherwise, they will break transmission-show tests

* fixup! ci: add run-tests composite action

fix windows, alpine breakage

* fixup! ci: add run-tests composite action

fix: sanitizer logging to stderr

* fixup! ci: add run-tests composite action

disable asan leak detection on macOS: the feature is unsupported there

* fixup! refactor: extract platform detection into its own composite action (#8158)

ensure bash is installed on alpine linux
2026-01-21 08:24:46 -06:00
Charles Kerr
62be679769 refactor: remove tr_session* argument from tr_rpc_response_func (#8160) 2026-01-20 19:44:06 -06:00
Yat Ho
cbc5388440 build: bump to C++20 (#7191)
* build: bump to C++20

Co-authored-by: Cœur <coeur@gmx.fr>

* refactor: use designated initializers

* refactor: remove redundant SFINAE

* fix: clang-tidy warnings

* chore: comments about min compiler versions for C++20 features

* build: clang objc++ modules build errors

Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* refactor: add `TR_CONSTEXPR_VEC` and `TR_CONSTEXPR_STR`

* fix: don't use `std::rel_ops`

* chore: housekeeping

* fix: possible fix for macOS linker error

---------

Co-authored-by: Cœur <coeur@gmx.fr>
Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-01-20 16:27:34 -06:00
Yat Ho
a3202cbe47 fix: incorrectly set error when moving across filesystems (#8167) 2026-01-20 11:16:47 -06:00
Yat Ho
7de5795cde ci: only setup nodejs if make-web == true (#8171) 2026-01-20 11:12:41 -06:00
Charles Kerr
49f6f20361 refactor: remove unused libtransmission api (#8169)
* refactor: remove tr_getDefaultConfigDirToBuf()

* refactor: remove tr_torrentFindFileToBuf()

* refactor: remove tr_torrentGetMagnetLinkToBuf()

* refactor: remove tr_getDefaultDownloadDirToBuf()

* refactor: remove tr_torrentGetTrackerListToBuf()

* refactor: remove tr_torrentFilenameToBuf()

* refactor: remove tr_strv_to_buf()
2026-01-19 17:35:12 -06:00
Yat Ho
f6d4585b38 fix(remote): crash when number argument is invalid (#8156)
* fix: crash when `--global-seedratio` argument is invalid

* fix: crash when `--global-idle-seeding-limit` argument is invalid

* fix: crash when `--peers` argument is invalid

* fix: crash when `--tracker-remove` argument is invalid

* fix: crash when `--seedratio` argument is invalid

* fix: crash when `--idle-seeding-limit` argument is invalid
2026-01-16 17:56:02 -06:00
Yat Ho
4e03de7630 fix: use weak pointers for ip cache curl callback (#8157) 2026-01-16 17:11:03 -06:00
Charles Kerr
6248b9d303 refactor: extract platform detection into its own composite action (#8158) 2026-01-16 12:59:30 -06:00
Charles Kerr
36ea62cf6e ci: add install-deps composite action (#8152) 2026-01-16 10:10:00 -06:00
Charles Kerr
f200bedd57 fix: crash on invalid command-line value for --cache / -e arg (#8147)
* fix: crash on invalid command-line value for --cache arg

* Update utils/remote.cc

Co-authored-by: Yat Ho <lagoho7@gmail.com>

---------

Co-authored-by: Yat Ho <lagoho7@gmail.com>
2026-01-16 02:45:49 -06:00
Yat Ho
5f16036459 ci: update and test more Fedora versions (#8151) 2026-01-16 00:28:12 -06:00
Yat Ho
66a7dcff2e ci: use cmake --install (#8149) 2026-01-15 22:49:00 -06:00
Yat Ho
c0c3700ec2 ci: remove redundant QT_QPA_PLATFORM definitions (#8150) 2026-01-15 22:15:44 -06:00
Charles Kerr
cfe9736a6e fix: potential use-after-free of NSString in tr_strv_convert_utf8() (#8131)
* fix: potential use-after-free bug when parsing torrent metainfo on macOS

* build: add -Warc-unsafe-retained-assign warning to detect any future ARC issues
2026-01-15 15:57:05 -06:00
Yat Ho
d83bb3bf45 chore: remove outdated comment in tr_num_parse (#8140) 2026-01-15 14:48:15 -06:00
Charles Kerr
a8f531b572 fix: remove unused tr_strbuf::join() (#8144) 2026-01-15 14:37:22 -06:00
Yat Ho
6ba8ec7e6f ci: bump actions and deps (#8141)
* ci: bump to `actions/checkout@v6`

* ci: bump to `actions/setup-node@v6`

* ci: bump to `actions/upload-artifact@v6`

* ci: bump to `actions/download-artifact@v7`

* ci: bump to `actions/cache@v5`

* ci: bump to `actions/setup-java@v5`

* ci: use gradle 8.13

* ci: bump to vcpkg `389d14fa0e0692f36967e9eb5499e909317644d5`

* ci: bump to `github/codeql-action@v4`

* ci: bump to ndk 27.3.13750724

* fix: define android namespace

* ci: don't pin ubuntu runner version for non-native builds
2026-01-15 14:15:47 -06:00
Yat Ho
1825a7fe46 chore: bump wide-integer (#8128) 2026-01-14 17:04:17 -06:00
Charles Kerr
677e0a6335 test: add tests for RpcClient (#8137)
* refactor do not cache style in convert_outgoing_data() -- not testing-friendly

* refactor: pass a QNetworkAccessManager into RpcClient constructor

this way we can inject a fake one in tests

* refactor: add RpcClient tests

* refactor: remove pointless QVERIFY call

* refactor: add api_compat::default_style()

* refactor: add api_compat::set_default_style()

* test: parameterize RpcClient tests for Tr4 and Tr5
2026-01-14 13:52:10 -06:00
Charles Kerr
0eb9032bee fix: typo in User-Agent from requests posted by trqt (#8135) 2026-01-14 12:29:52 -06:00
Yat Ho
5bf94ba45c chore: bump small (#8129) 2026-01-14 08:49:57 -06:00
Charles Kerr
140958a8a1 refactor: no macros in transmission.h (#8099)
* refactor: replace TR_RPC_SESSION_ID_HEADER macro with TrRpcSessionIdHeader constant

refactor: replace TR_RPC_RPC_VERSION_HEADER macro with TrRpcVersionHeader constant

* refactor: remove macro TR_DEFAULT_RPC_PORT_STR

* refactor: remove macro TR_DEFAULT_PEER_PORT_STR

* refactor: remove macro TR_DEFAULT_PEER_LIMIT_GLOBAL_STR

* refactor: remove macro TR_DEFAULT_PEER_LIMIT_TORRENT_STR

* refactor: remove macro TR_DEFAULT_PEER_SOCKET_TOS_STR

* refactor: replace DEFAULT_BLOCKLIST_FILENAME macro with TrDefaultBlocklistFilename constant

* refactor: rename TrHttpServerDefaultBasePath to TrDefaultHttpServerBasePath for consistency with other defaults

* refactor: group constants together near the top of transmission.h

* refactor: hardcode string lengths to avoid FTBFS on older C++17 compilers

* refactor: move macros to the tr_getopt clients

* refactor: explicitly specify the parameter index to avoid passing in TrRpcSessionIdHeader twice

* refactor: add an error message to new static_asserts
2026-01-14 07:52:57 -06:00
Charles Kerr
70bc3eec48 perf: faster tests (#8113)
* refactor: make libcurl thread shutdown faster during tests

* docs: fix out-of-date code comment in web.h

* refactor: tr_sessionClose() now takes fractions of seconds for deadline

refactor: make tr_web::startShutdown() deadline dependent on the tr_sessionClose() deadline arg

* test: set tr_sessionClose() deadline of 0.5 secs

* refactor: FileTest now inherits from SandboxedTest

* fixup! test: set tr_sessionClose() deadline of 0.5 secs
2026-01-13 19:08:25 -06:00
Yat Ho
8b8bfed2e8 chore: remove <charconv> workaround for older GCC (#8119) 2026-01-13 19:08:05 -06:00
Yat Ho
3df2b2fb14 refactor: implement tr_strv_sep() as a wrapper of find_first_of() (#8117)
* refactor: implement `tr_strv_sep()` as a wrapper of `find_first_of()`

* test: `tr_strv_sep` other overloads
2026-01-13 17:05:22 -06:00
Yat Ho
7a8d29b0a6 refactor: log blocklist line that failed to parse (#8118) 2026-01-13 15:03:04 -06:00
Yat Ho
4f7b932fee build: correctly set MSVC __cplusplus (#8120)
* build: correctly set MSVC `__cplusplus`

* refactor: let utf8cpp infer `UTF_CPP_CPLUSPLUS`
2026-01-13 15:02:50 -06:00
Charles Kerr
8dea0e863f fix: several CI errors (#8124)
* Revert "build(cmake): support building with (almost) all system 3rd-party libraries (#7554)"

This reverts commit a89ca4f2c9.

* fixup! refactor: use a map of getters, setters for `session_get` and `session_set` properties (#8024)

fix: capture-by-reference error in session_accessors()

* fix: 'Qt depends on a UTF-8 locale' CI warning

* fix: 'qt.qpa.xcb: could not connect to display' CI error
2026-01-13 13:16:40 -06:00