* refactor: callers now own the return value of tr_torrentStat()
fix one potential thread issue by simplifying ownership
* refactor: make tr_stat_errtype an enum class; move into tr_stat
* refactor: order tr_stat fields to reduce padding
* chore: fix branch shear
* fix: int-to-enum-class comparison
* fix: namespace regression
* chore: make clang-tidy happy
* 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
* 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
* 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>
* 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
* 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
* 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.
* 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
* fix(remote): attach id to `session_set` requests
* fix(remote): attach id to `torrent_set` requests
* fix(remote): attach id to `torrent_set_location` requests
* fix(remote): attach id to `torrent_rename_path` requests
* feat: sniff TR_RPC_RPC_VERSION_HEADER in 409 headers
* refactor: use api_compat::convert() when sending requests
* refactor: update to JSON-RPC: print_session()
refactor: update to JSON-RPC: print_session_stats()
* refactor: update to JSON-RPC: print_session()
refactor: update to JSON-RPC: print_details()
* refactor: update to JSON-RPC: print_file_list()
* refactor: update to JSON-RPC: print_torrent_list()
* refactor: update to JSON-RPC: print_trackers()
* refactor: update to JSON-RPC: print_port_test()
* refactor: update to JSON-RPC: print_pieces()
* refactor: update the rest
* feat: check the JSON-RPC version number too
* feat: better errmsg detection
* chore: remove accidentally-committed tracer
* fix: regression
* chore: remove accidentally-committed tracer
* fix: return the right variable in serialize_payload()
* fix: check for blocklist_update too
* perf: reserve the right number of args
* refactor: remove unnecesary logic branch
* perf: avoid unnecessary tr_variant.clone() call
* fixup! feat: check the JSON-RPC version number too
tearfur's code was fine; I introduced this bug as committer
* fix: handle http 204 replies silently
---------
Co-authored-by: Yat Ho <lagoho7@gmail.com>
* refactor: add quarks for the RPC method names
* update tr_quark_convert() to handle RPC method names
* refactor: use interned keys for RPC method names
* test: add torrentGetLegacy test
* refactor: use interned keys for RPC method names in tr-qt
* refactor: use interned keys for RPC method names in tr-remote
* refactor: use interned keys for RPC method names in tests
* refactor: use interned keys for RPC method names in tr-gtk
* chore: fix readability-identifier-naming regression
* feat: store `preferred_transports` as array in `settings.json`
* refactor: `Settings::save()` returns `tr_variant::Map`
* feat: new RPC API for `preferred_transports`
* feat: new arg `--preferred-transports` for remote
* refactor: remove evbuffer use in transmission-remote
Keep reducing our libevent API use, especially outside of libtransmission
* chore: reduce some unnecessary diffs to main
* chore: bump fmt to 11.2.0
Acquire 6797f0c39a, which fixes compile error on GCC 15.1.
Acquire
9f269062a7,
which fixes buffer overflow in NetBSD 10.1 on GCC 10.5.
Replace `fmt::localtime` with `std::localtime`, as `fmt::` is now
deprecated.
* fix: format timezone ourselves on Windows
{fmt} 11.2.0 removed the ability to format `std::tm` with the format specifier `%z` on Windows, for a good reason. Ref: https://github.com/fmtlib/fmt/issues/4444
This forces us to implement our own solution on Windows as there's no alternative.
* fix: support `FMT_USE_EXCEPTIONS`
* build: clang-tidy headers when building libtransmission
* chore: revert `= default` workaround
It was introduced in 6909ec0bad to fix build issues with macOS 10.14. We
no longer support that version.
* fix: clang-tidy warnings for libtransmission
* build: clang-tidy headers when building tests
* fix: clang-tidy warnings for tests
* build: clang-tidy headers when building qt
* code review: don't manually edit mime-types.h
* code review: unify variable naming for static private members
* 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>
Uses `fmt::print` to log failure messages. Results in a connection
failure being printed as:
Unable to send request to 'http://localhost:9091/transmission/rpc/': Couldn't connect to server
Fixes#7010