714 Commits

Author SHA1 Message Date
Yat Ho
9dd9aab902 build: bump clang tools to 20 (#7573)
* build: bump to clang-format-20

* build: bump to clang-tidy-20

* chore: revert edc59ba5d8
2025-12-01 23:18:02 -06:00
Yat Ho
8d25484cdb refactor: use new tr_variant API in daemon (#7103) 2025-11-12 13:04:55 -06:00
Yat Ho
648c65868c feat: use Type=notify-reload in daemon service (#7570)
* feat: use `Type=notify-reload` in daemon service

* build: keep systemd names consistent

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-10-29 09:04:04 -05:00
Managor
3f7e1e4309 Update transmission-daemon.1 (#7559) 2025-10-16 08:45:27 -05:00
Yat Ho
9c14fa58d8 feat: allow optional arguments in tr_getopt() (#7510)
* feat: allow optional arguments in `tr_getopt()`

* test: new tests for optional arg

* code review: `using Arg = tr_option::Arg`

* refactor: static assert option array size

* test: add new tests for missing arguments in the middle

* test: static auto constexpr
2025-10-15 12:08:11 -05:00
Yat Ho
c215de34d5 chore: move away from fmt/core.h (#7557) 2025-05-06 01:01:12 -05:00
Yat Ho
cf7ac07a6c build: support different install prefixes for daemon service file (#7571)
* build: support different install prefixes for daemon service file

* code review: add `@ONLY`
2025-05-01 15:09:49 +01:00
Yat Ho
7b83c7d625 refactor: rename unreleased quarks to snake_case (#7483)
* refactor: rename `sequentialDownload` to `sequential_download`

* refactor: rename `beginPiece` to `begin_piece`

* refactor: rename `endPiece` to `end_piece`

* refactor: rename `ipProtocol` to `ip_protocol`

* refactor: rename `preferred-transport` to `preferred_transport`
2025-03-10 17:30:19 -05:00
Yat Ho
86e904d1a2 feat: sequential download cmdline options in remote and daemon (#7048)
* feat: add seq option in remote

* feat: print session sequential download setting in remote

* refactor: assert options torrent size in daemon

* feat: add seq option in daemon
2025-03-10 16:16:25 -05:00
Dzmitry Neviadomski
7e87adcd91 Fix building transmission with C++23 (#6832)
* fix: operator== should return bool in tr_strbuf

Fixes build error with C++20/C++23

error: return type 'auto' of selected 'operator==' function for rewritten '!=' comparison is not 'bool'

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* fix: explicitly specify Blocklist::size() return type as size_t

Fixes building with C++20/C++23
error: no matching function for call to 'size'
function 'size' with deduced return type cannot be used before it is defined

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* fix: wrap runtime format strings with fmt::runtime in library, daemon and cli

fmt::format_string ctor is consteval with C++20
See https://github.com/fmtlib/fmt/issues/2438

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* fix: wrap runtime format strings with fmt::runtime for GTK client

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* fix: allow to override C and CXX standard via cmdline or env

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* fix: add job to check if transmission compiles with C++23

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* Address code review by mikedld

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* fix new found fmt build errors

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* Address code review by tearfur

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* fix: make tr_net_init_mgr singleton buildable with C++23

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

---------

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-10 13:08:57 -05:00
Yat Ho
131caa1239 refactor: convert tr_net_init_mgr to singleton (#6914) 2024-12-30 09:32:11 -06:00
Yat Ho
2c82f3d83d fix: add missing settings.json docs and app defaults (#7218)
* docs: `trash-can-enabled` gtk only

* fix: add `pidfile` to daemon app defaults

* perf: don't copy string literal to variant
2024-10-31 22:14:44 -05:00
Yat Ho
819d7f4136 fix: check tr_num_parse result in daemon (#7181) 2024-10-20 23:52:52 -05:00
luk1337
ed2c6c4085 fix: Use non-lib64 systemd system unit dir path (#7115)
This is a common path across Linux distros.

Checked distros:
* Arch Linux
* Fedora
* Gentoo
* openSUSE
* Ubuntu
2024-09-24 00:32:25 +01:00
Yat Ho
04c115f79c fix: accurate timestamp in daemon logs (#7009)
* fix: accurate timestamp in daemon logs

* fix: gtk build errors

* fixup! fix: gtk build errors

* code review: use system_clock typedefs

* code review: use the full buffer for string view

* fixup! fix: accurate timestamp in daemon logs

* code review: limit exposure of `using`
2024-08-13 23:57:52 +01:00
niol
be67b33f42 systemd service documentation key (#6781)
Co-authored-by: Barak A. Pearlmutter <barak+git@pearlmutter.net>
2024-05-25 11:51:51 -05:00
Cœur
460ce7c302 Add start_paused to settings file and daemon (#6728)
* Add daemon-startPaused to settings file

* code review: naming

* "Predefined quarks must be sorted by their string value"

* code review: replacing paused_ with tr_variantDictAddBool/tr_variantDictFindBool

* code review: doc

* Update docs/Editing-Configuration-Files.md

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

---------

Co-authored-by: Eugen Beck <beck@cs.rwth-aachen.de>
Co-authored-by: Yat Ho <lagoho7@gmail.com>
2024-03-30 16:39:44 -05:00
Charles Kerr
1855cdb731 refactor: replace tr_sys_file_write_line() with fmt::print("...\n") (#6619)
* refactor: use fmt::print in log.cc

https://github.com/fmtlib/fmt/issues/428#issuecomment-395442159
> You can use fmt::print("...\n") on Windows as well.

Use this mechanism instead of tr_sys_file_write_line()

* refactor: use FILE* in daemon

* refactor: remove unused tr_sys_file_flush_possible()

* refactor: remove unused tr_sys_file_write_line()

* refactor: remove unused tr_sys_file_get_std()

* refactor: remove unused tr_std_sys_file_t
2024-02-25 16:12:08 -06:00
Yat Ho
8b8e9f5c6d fixup! fix: include daemon-specific options in app defaults (#6505)
* fixup! fix: include daemon-specific options in app defaults (#6499)

* fix: windows build failure

* Revert "fixup! fix: include daemon-specific options in app defaults (#6499)"

This reverts commit 92c2106cc607df36aca4ba28e8c20bd96fa87688.

* refactor: define daemon-specific quarks in libtransmission
2024-01-11 13:20:22 +00:00
Yat Ho
7fd29d2d46 fix: include daemon-specific options in app defaults (#6499) 2024-01-07 11:12:31 -06:00
Charles Kerr
3f6969217c chore: remove FMT_STRING macros (#6497) 2024-01-06 14:05:18 -06:00
Yat Ho
4bb9eab0d0 fix: app defaults should override libtransmission defaults (#6495) 2024-01-06 10:10:14 -06:00
Charles Kerr
646883174b chore: fix misc-use-anonymous-namespace warnings from clang-tidy (#6488) 2024-01-04 23:12:51 -06:00
Mike Gelfand
9c4d28dd08 fix: a couple of logging format issues (#6463)
* Fix swapped log args in `do_log_system_error()`

* Fix invalid fmt use in `tr_rpc_server::load()` logging
2023-12-30 08:56:34 -06:00
LaserEyess
b562983cbd Harden systemd service (#6391)
This commit includes strict, but still compatible, service hardening for
transmission-daemon.service. The main goal is a defense-in-depth
strategy that protects users from unknown vulnerabilities in
transmission.

In practice, transmission does not use any of the features that are
blocked in this hardening. However, this is still a network facing
daemon that, by design, accepts connections from unknown peers. So
better safe than sorry.

This commit also installs the service via CMake

Co-authored-by: LaserEyess <LaserEyess@users.noreply.github.com>
2023-12-24 20:48:18 -06:00
Charles Kerr
e14806c409 refactor: c++ify libtransmission's tr_ctor struct (#6295) 2023-11-26 15:43:37 -06:00
Charles Kerr
2e32789193 refactor: add libtransmission::Values (#6215) 2023-11-09 08:39:06 -06:00
Charles Kerr
a952a0731f refactor: remove the tr_error** idiom (#6198)
* refactor: remove the tr_error** idiom

* fix: tr_error::message() is only constexpr in c++20 and up

* chore: silence a couple of g++-12 Wshadow warnings
2023-11-04 11:39:41 -05:00
Yat Ho
a2b547fb50 chore: iwyu (#6201) 2023-11-03 12:03:26 -05:00
Julien
8ac323d5d6 chore: removed copyright timespans in headers (#4850) 2023-11-01 16:11:11 -05:00
Rafe S
94aeff9bc2 docs: update log-level in transmission-daemon.1 manpage (#6059)
Add entry for log-level, mark log-error, log-info, and log-debud as deprecated.
2023-10-01 18:21:14 -05:00
Charles Kerr
6ead147620 refactor: use new tr_variant API in tr_session (#6006) 2023-09-16 08:23:35 -05:00
Charles Kerr
ebb1b775af refactor: public tr_session settings API now returns tr_variants (#5983) 2023-09-07 19:05:16 -05:00
Charles Kerr
5837603b6f refactor: make tr_variant follow RAII (#5923) 2023-08-20 23:15:23 -05:00
Charles Kerr
a4d205612a refactor: add tr_variant_serde (#5903) 2023-08-17 11:02:45 -05:00
tearfur
5ec4ca550e chore: iwyu (#5746) 2023-07-08 10:24:03 -05:00
tearfur
0f85c9e0e4 fix: memory leak from signal handling event in daemon (#5695) 2023-07-07 17:18:38 -05:00
tearfur
2211086338 fix: conform to libcurl requirements to avoid memory leak (#5702) 2023-07-05 22:05:03 -05:00
Charles Kerr
0bb222b2cb perf: avoid heap allocations in daemon::printMessage() (#5724) 2023-07-04 12:00:46 -05:00
Charles Kerr
8183d7fddf refactor: utils naming (#5696)
* chore: rename tr_strvContains to tr_strv_contains

* chore: rename tr_strvStartsWith to tr_strv_starts_with

* chore: rename tr_strvEndsWith to tr_strv_ends_with

* chore: rename tr_strvSep to tr_strv_sep

* chore: rename tr_strvStrip to tr_strv_strip

* chore: rename tr_strvToBuf to tr_strv_to_buf

* refactor: rename tr_saveFile() to tr_file_save()

rename tr_loadFile() to tr_file_read()

rename tr_moveFile() to tr_file_move()

* refactor: rename tr_parseNum() to tr_num_parse()

refactor: rename tr_parseNumRange() to tr_num_parse_range()

* chore: group related functions together in header
2023-06-30 09:49:58 -05:00
tearfur
41cfdce6fd refactor: replace some C idioms with C++ ones (#5656)
* tidy up legecy practices

* remove undefined std::ignore usage

* avoid extra function stack level in daemon.cc
2023-06-22 17:58:16 -05:00
Charles Kerr
0d3b321bac refactor: use snake_case for libtransmission class methods (#5497) 2023-05-05 23:11:05 -05:00
Mike Gelfand
e8fcb025a0 fix: use user-preferred locale (#5444)
* Use user-preferred locale

Previous fix adding `L` format specifier was correct but only fixed half
of the problem, as C++ locale is set up to be "C" by default. GTK client
used to call `setlocale(LC_ALL, "")` to set up user-preferred locale
which only affected C functions and `std::locale` (used by libfmt) was
unaware of those changes.

Apply the fix to all the binaries since they're all doing some sort of
output to the user and calling libtransmission helpers, as well as using
libfmt directly.

* Improve libtransmission's json-test

Set the locale C++ way to avoid any sort of inconsistencies, and also
restore it to the old one once finished testing.

* Improve transmission-show test runner script

Quote outputs to avoid CMake error about `message()` being called with
no arguments. Capture stderr to the same output file. Fallback to `git
diff` if `diff` wasn't found. A few other minor changes.
2023-04-27 09:10:33 -05:00
Charles Kerr
7d86d67bc7 chore: prefer fmt/core.h over fmt/format.h (#5404) 2023-04-16 15:34:19 -05:00
Roey Fuchs
cfcd7148ad fix: make "unexpected argument" error message easier to read (#5029) 2023-02-24 15:47:51 -06:00
Julien
4b8cfa2e57 chore: update copyrights to 2023 (#4834) 2023-02-11 14:49:42 -06:00
Dmitry Antipov
770da79cf3 daemon: check whether log file is regular and may be flushed (#4612) 2023-01-18 12:46:57 -06:00
Mike Gelfand
57e6b06921 Modernize CMake code (ongoing refactoring) (#4515)
* Use imported CMake target for CURL

* Use imported CMake target for fmtlib

* Use imported CMake target for WideInteger

* Use imported CMake target for FastFloat

* Use imported CMake target for UtfCpp

* Use imported CMake target for Threads

* Use imported CMake target for Iconv

* Use imported CMake target for crypto backend

* Use imported CMake target for GTK

* Use imported CMake target for Qt

* Use imported CMake target for deflate

* Use imported CMake target for libevent

* Use imported CMake target for natpmp

* Use imported CMake target for miniupnpc

* Use imported CMake target for dht

* Use imported CMake target for psl

* Use imported CMake target for libutp

* Use imported CMake target for libb64

* Use include directories from libtransmission target
2023-01-02 16:23:51 +00:00
Mike Gelfand
bc380511db Modernize CMake code (ongoing refactoring) (#4507)
* Reformat CMake code

* Bump minimum CMake version to 3.12

* Add target sources separately via `target_source()`

* Make `tr_win32_app_info()` add target sources on its own

* Don't use `include_directories()`

* Don't use `add_definitions()`

* Limit use of `add_compile_options()`

* Move VDKQueue target declaration to a subdirectory

* Add `tr_disable_source_files_compile()` helper

* Add `tr_target_glib_resources()` helper

* Add `tr_gettext_msgfmt()` helper

* Enable AUTOUIC for Qt client

* Enable AUTORCC for Qt client

* Remove AUTO{MOC,RCC,UIC} source group overrides

* Add `tr_target_idl_files()` helper

* Move source group setup to `tr_qt_add_translation()`

* Add `tr_target_xib_files()` helper

* Prefer `target_sources()` to intermediate variables

* Use explicit visibility versions of `target_*()` commands

* Prefer genexes to conditions in `target_*()` commands

* Add `tr_allow_compile_if()` helper

* Leave only top-level `project()`, remove the rest

* Minor fixups

* Fixup Mac QL plugin install

* Fixup IDE target folders and source groups
2023-01-01 19:49:48 +00:00
Cœur
db802afc4f Addressed various warnings (#4414) 2022-12-21 14:21:16 -06:00