Commit Graph

16690 Commits

Author SHA1 Message Date
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
Charles Kerr
6f32b8d5dd refactor: move display types to UserMetaType.h (#8116) 2026-01-12 20:07:55 -06:00
Charles Kerr
4a05c06ce0 perf: add batch variant of tr_torrentStat() (#8100)
* refactor: add [Torrent updateTorrents]

refactor: use updateTorrents in Controller

* refactor: add a batch variant of tr_torrentStat()

* refactor: use batch variant of tr_torrentStat() in GTK details dialog

* refactor: use batch variant of tr_torrentStat() in gtr_confirm_remove()

* refactor: use batch variant of tr_torrentStat() in updateTorrents

* refactor: add Session::find_torrents()

* refactor: remove the raw ptr variant of updateTorrents()

* refactor: remove tr_sessionLock()

* fixup! refactor: add [Torrent updateTorrents]

remove duplicate method declaration

* fix: readability-avoid-const-params-in-decls

* fix: iwyu in transmission.h

* chore: remove an #include that was added in a draft that did not get used

* refactor: use nullptr instead of NULL
2026-01-12 16:23:06 -06:00
Yat Ho
a89ca4f2c9 build(cmake): support building with (almost) all system 3rd-party libraries (#7554)
* build: overhaul tr_add_external_auto_library

* build: use package-provided CMake config file libevent

* build: use package-provided CMake config file miniupnpc

* build: update libutp find module

* build: make LIBNAME an optional parameter

* build: use package-provided CMake config file libdeflate

* build: update libb64 find module

* build: update libnatpmp find module

* build: update libpsl find module

* build: support system fast_float library

* chore: reformat long brew commands

* build: support system fmt library

* build: support system rapidjson library

* build: support system small library

* build: support system library utf8cpp

* build: support system library WideInteger

* build: support system library gtest

* fix: incorrectly labeled test suites

* build: remove unused parameters from tr_add_external_auto_library

* build: update crc32c cmake script

* fix: dht system library

* fix: add libutp interface target

* code review: move TrGtest.cmake

* code review: move tr_get_fmt_version into Findfmt.cmake

* code review: use option() for gtest

* code review: move find_package(PkgConfig) out of loop

* build: delete FindCrc32c.cmake

Impossible to parse package version from distributed source files.

* code review: Finddht.cmake

* build: delete FindFastFloat.cmake

Impossible to parse package version from distributed source files.

* code review: Findfmt.cmake

* code review: Findlibb64.cmake

* code review: Findlibdeflate.cmake

* code review: Findlibevent.cmake

* code review: Findlibnatpmp.cmake

* code review: Findlibpsl.cmake

* code review: Findlibutp.cmake

* code review: Findlibminiupnpc.cmake

* code review: FindRapidJSON.cmake

* build: delete FindSmall.cmake

Impossible to parse package version from distributed source files.

* build: only accept cmake config package for utf8cpp

Impossible to parse package version from distributed source files.

* build: delete FindWideInteger.cmake

Impossible to parse package version from distributed source files.

* build: add `USE_SYSTEM_DEFAULT`

* ci: drop Fedora 40 and adopt Fedora 43

* ci: try to silence system header warnings

* ci: use `cmake --install`

* Revert "build: only accept cmake config package for utf8cpp"

This reverts commit 2158d631fd.

* build: harden utf8cpp find module

* chore: bump wide-integer

Pick up bf9398f9da and bcc726a30f

* refactor: gtest should be included with angled brackets

Now that gtest is built as a system library, it should be included with angled brackets instead of quotes.

* code review: fixup libutp variables before `find_package_handle_standard_args`

* code review: define `WIDE_INTEGER_HAS_LIMB_TYPE_UINT64` only for targets depending on WideInteger

* chore: bump wide-integer

Pickup 4b2258acac so that wide-integer tests won't run in Transmission project.
2026-01-12 09:04:47 -06:00
Charles Kerr
d177f9f903 test: add unit tests for Prefs (#8112)
* fix: hicpp-use-auto,modernize-use-auto

* refactor: make Prefs::getKey() a static method

refactor: make Prefs::isCore() a static method

refactor: make Prefs::type() a static method

* refactor: Application takes a Prefs& arg, not a std::unique_ptr<Prefs> arg

* fix: bugprone-exception-escape

save settings by calling prefs.save() from main()

* refactor: load settings by calling prefs.load() from main()

* refactor: use preferred declaration order in Prefs

* fixup! fix: bugprone-exception-escape

* refactor: add Prefs::current_values()

* refactor: clean up namespace use in Prefs.cc

* feat: add QString, QDateTime serializers

* test: add scaffolding for testing Qt code

test: add tests for Prefs

* refactor: remove unused #includes

* build: add clang-tidy rules to tests/qt/

* refactor: clean up the new test code a little

* chore: add missing copyright statement

* ci: ensure Qt6Test is installed

build: check for QTest when ENABLE_TESTS + ENABLE_QT are ON

* fixup! feat: add QString, QDateTime serializers

* fix: Wswitch warning

* build: do not disable tests in release/windows/build-qt5.psl, build-qt6.psl

* ci: set QT_QPA_PLATFORM for running new Qt tests

* test: build cleanly in Qt 5.15

* fixup! fixup! feat: add QString, QDateTime serializers

fix QDateTime serializer on macOS

* fixup! ci: set QT_QPA_PLATFORM for running new Qt tests

install xcb-util-cursor on alpine
2026-01-11 19:23:00 -06:00
Yat Ho
cf0a596a45 fix: url port parsing (#8109)
* fix: url port parsing

- `tr_urlParse()` should fail if cannot parse port
- Avoid parsing scheme ports to numbers
- Port should not be parsed to a negative number
- Port should not be parsed to `0`
- Directly parse number string to `uint16_t`

* test: invalid port
2026-01-11 11:43:12 -06:00
Charles Kerr
4c60472aae refactor: add helpers to avoid code duplication (#8101)
* refactor: add helpers to avoid code duplication

* refactor: remove unused default_value arg
2026-01-10 08:25:36 -06:00
Yat Ho
721a3dd0e3 fix: bufferevent_read never returns -1 (#8107) 2026-01-10 06:59:48 -06:00
Charles Kerr
781bb3f3d4 fix: 4.1.0-beta.5 regression using trqt as a remote (#8103) 2026-01-09 23:11:27 -06:00
Yat Ho
0de550663d fix: rebind udp sockets on bind-address change (#8096) 2026-01-09 16:16:36 -06:00
Yat Ho
f2d2edbdb9 refactor: use new tr_variant API in peer-msgs.cc (#8091)
* refactor: convert `tr_peerMsgsImpl::parse_ut_pex()`

* refactor: convert `tr_peerMsgsImpl::send_ltep_handshake()`

* refactor: convert `tr_peerMsgsImpl::parse_ltep_handshake()`

* refactor: convert `tr_peerMsgsImpl::parse_ut_metadata()`

* refactor: convert `tr_peerMsgsImpl::maybe_send_metadata_requests()`

* refactor: convert `tr_peerMsgsImpl::add_next_metadata_piece()`
2026-01-09 15:58:20 -06:00
Charles Kerr
47832db7b2 refactor: move tr_diffserv_t::Names into serializer (#8088)
* refactor: move tr_diffserv_t::Names into serializer

* Update libtransmission/serializer.cc
2026-01-09 14:39:54 -06:00
Yat Ho
cf3799fb42 build: change cppcoreguidelines-* to opt-out (#8097)
* build: change `cppcoreguidelines-*` to opt-out

* fix: `cppcoreguidelines-rvalue-reference-param-not-moved`

* chore: add todo for `cppcoreguidelines-pro-bounds-pointer-arithmetic`

* fix: `cppcoreguidelines-missing-std-forward`
2026-01-09 13:39:34 -06:00
Charles Kerr
12c7e2d847 refactor: remove if-c++ guards in transmission.h; require c++ now (#8098) 2026-01-09 13:23:04 -06:00
Yat Ho
9d100d8742 build: re-enable clang-analyzer-optin.core.EnumCastOutOfRange check (#8095) 2026-01-09 09:45:08 -06:00
Yat Ho
d7f4bfe063 chore: remove workaround for llvm#98823 (#8092) 2026-01-09 07:28:37 -06:00
Yat Ho
d7babab6ba refactor: convert tr_bandwidth::RateControl::newest_ to unsigned (#8094) 2026-01-09 07:25:30 -06:00
Charles Kerr
a3b4b0a87f refactor: make Qt prefs dialog a little more typesafe (#8089)
* chore: sync translations (#8059)

* Sync translations with code

* Sync translations with Transifex

* chore: savepoint

* chore: remove tracers

* refactor: rename PrefsDialog private method names for consistency

* refactor: add PrefsDialog::initComboFromItems()

* refactor: use tr_encryption_mode in initEncryptionCombo()

* refactor: make PortTestStatus an enum class

* refactor: reverse pair order in initComboFromItems()

* fix: disambiguation when calling connect() on overloaded method

---------

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2026-01-09 07:24:48 -06:00
Yat Ho
54665bbab3 fix: bugprone-narrowing-conversions in torrent-magnet.cc (#8081)
* refactor: replace `std::lldiv` with `/` and `%`

`std::lldiv` is equivalent to `/` and `%` by definition, and compilers optimise `/` + `%`.

https://stackoverflow.com/a/4912226/11390656

* fix: `bugprone-narrowing-conversions` in `torrent-magnet.cc`

* code review: always divide by metadata piece size

* perf: make n_metadata_pieces constexpr noexcept
2026-01-08 20:03:46 -06:00
Yat Ho
1e911dacdf fix: remove artificial max metadata size limit (#8082) 2026-01-08 08:46:08 -06:00
Yat Ho
0f58c88221 fix: tr_torrent::seed_ratio_ should be double (#8084) 2026-01-08 08:14:03 -06:00
Charles Kerr
9236827ba5 refactor: use symbolic names for server relative paths (#8080)
* refactor: use TrHttpServerDefaultBasePath in remote.cc

refactor: use TrHttpServerRpcRelativePath in remote.cc

* refactor: use TrHttpServerDefaultBasePath in rpc-server.cc

refactor: use TrHttpServerRpcRelativePath in rpc-server.cc

* refactor: remove unused TR_DEFAULT_RPC_URL_STR
2026-01-08 08:12:26 -06:00
Charles Kerr
0b6d02c186 fix: use URL base path (#8077)
Xref: feat: Remote session RPC url path change option qt client (#7561)
2026-01-07 15:46:47 -06:00
Yat Ho
0b55b39189 refactor: use time_t for all idle_seconds operations (#8075) 2026-01-07 14:37:36 -06:00
Yat Ho
2b2ffd8682 refactor: move anti brute force getters and setters to class methods (#8076)
* refactor: move `set_anti_brute_force_enabled` to `tr_session`

* refactor: move `is_anti_brute_force_enabled` to `tr_session`

* refactor: move `set_anti_brute_force_limit` to `tr_session`

* refactor: move `get_anti_brute_force_limit` to `tr_session`
2026-01-07 13:05:59 -06:00
Charles Kerr
9b52950a96 refactor: remove redundant Prefs class methods in trqt (#8069)
* refactor: replace Prefs.getInt() with Prefs.get<int>()

* refactor: replace Prefs.getBool() with Prefs.get<bool>()

* refactor: replace Prefs.getDouble() with Prefs.get<double>()

* refactor: replace Prefs.getString() with Prefs.get<QString>()

* refactor: replace Prefs.getDateTime() with Prefs.get<QDateTime>()

* refactor: remove Prefs::toggleBool()

* refactor: remove unused Prefs::isClient()
2026-01-06 10:01:42 -06:00
Yat Ho
8a0d5f0648 fix(mac): copyright notices (#8068)
* chore(mac): fix copyright year

* chore(mac): use em dash in copyright notice

* fix(ci): check for emdash in copyright notice

* fix(ci): process QuickLookExtension plist files
2026-01-05 21:47:26 -05:00
Charles Kerr
11d3fc6f5a fix: qt sessionSet() encryption (#8067) 4.1.0-beta.5 2026-01-05 19:05:46 -06:00
Charles Kerr
a63bbf7273 chore: bump to 4.1.0-beta.5 (#8066) 2026-01-05 18:15:23 -06:00
Mitch Livingston
ea7c84b174 #7908: Explicitly flag menu item icons as "action image" (#8055)
This will make the icons only appear in macOS 26+, without having to manually remove them for earlier releases. This also will allow us to use newer symbol images.
2026-01-05 17:15:44 -06:00
Charles Kerr
f360d5cc0f docs: add release notes for 4.1.0-beta.5 (#8065) 2026-01-05 16:07:38 -06:00
Charles Kerr
5a1b959874 fix: encryption mode regression in Qt app (#8064)
recognize settings.json value for encryption preferences
2026-01-05 15:26:35 -06:00
Mike Gelfand
cf0cec32f5 chore: sync translations (#8059)
* Sync translations with code

* Sync translations with Transifex
2026-01-04 11:45:46 -06:00
Nick
866809aa36 Fix copyright year (#8058)
Fix copyright typo introduced in #8039
2026-01-04 07:58:52 -06:00
Mitchell Livingston
0335d02bd1 Only show file inspector menu action images on macOS 26+ 2026-01-03 10:06:16 -05:00
Charles Kerr
c8d4ce9e9a refactor: de-intern display mode strings (#8052)
* refactor: replace should_convert_child_strings() with a State.path stack

* refactor: de-intern the TR_KEY_sort_ keys

* refactor: de-intern the TR_KEY_show_ keys
2026-01-03 07:41:06 -06:00
Charles Kerr
046de3f6f0 refactor: use a map of getters, setters for session_get and session_set properties (#8024)
* refactor: session_get, session_set use an accessor table

* fix: lambda capture of structured binding declaration

* fix: readability-identifier-naming

* fix: regression

* chore: remove redundant code

* fix: regression

* chore: fix patch shear after rebase

* fix: namespace regression

Co-authored-by: Yat Ho <lagoho7@gmail.com>
2026-01-02 22:39:37 -06:00
Charles Kerr
d7d0d87f78 refactor: remove tr_url_query_view (#8049)
replace bespoke struct with std:: container
2026-01-02 22:39:37 -06:00
Yat Ho
3a4e115c52 fix: wishlist edge case when got bad piece in unaligned torrents (#8047)
* test: add failing test case

* fix: got bad piece in unaligned torrents
2026-01-02 13:04:53 -06:00
Yat Ho
03b5035d88 fix: unconst variable to be moved (#8048) 2026-01-02 12:39:39 -06:00
Yat Ho
f93165c0bc feat: unify encryption mode serialization format for settings.json and rpc (#8032)
* feat: `settings.json` `encryption` is now string

* feat: api-compat for encryption in `settings.json`

* feat: rpc now uses the same strings as `settings.json` for encryption modes

* feat: api-compat for encryption in rpc

* code review: use `to_variant()`
2026-01-02 11:38:54 -06:00
Yat Ho
60c0a176ce refactor(qt): use enum values to define encryption dropdown (#8034) 2026-01-02 11:36:40 -06:00
Yat Ho
d726c0d213 fix: optional serializer edge cases (#8044)
* fix: should reject when deserializing wrong optional type

* fix: reject nested optionals in serializer
2026-01-02 10:40:59 -06:00