Commit Graph

16295 Commits

Author SHA1 Message Date
Yat Ho
0fd35eb070 fix: remove duplicated mime types and prefer iana source (#7590)
* fix: remove duplicated mime types and prefer iana source

* refactor: use raw string literals just to be safe

* code review: prefer specific types over octet stream
2025-05-10 08:59:22 +01:00
Yat Ho
d9a7c3ab94 chore: mark web files as generated (#7588) 2025-05-08 21:44:06 +01:00
Yat Ho
08ec7fb7c7 build: lint header files with clang-tidy (#7527)
* 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
2025-05-07 22:10:16 +01:00
Yat Ho
f0c8fd689a fix(remote): print label separators correctly (#7535) 2025-05-06 22:09:29 +01:00
Yat Ho
adea0e2a07 build: tell clang-tidy to suggest uppercase literal suffixes (#7529) 2025-05-06 22:07:43 +01:00
Yat Ho
c215de34d5 chore: move away from fmt/core.h (#7557) 2025-05-06 01:01:12 -05:00
Yat Ho
f4345fbae1 docs: recommend to keep the cache small (#7519) 2025-05-06 03:58:11 +01:00
Yat Ho
c016e97dcd chore: silence clang-tidy warnings (#7586) 2025-05-06 02:00:48 +01:00
Mike Gelfand
1aebc3c0cb Simplify logic around gettext/libintl use (#7582)
* Simplify logic around gettext/libintl use

Use CMake-provided FindIntl module to look for the library and includes. Don't
check for functions existence, both `gettext()` and `ngettext()` are available
for ages now. Remove Windows- and Mac-specific logic, always use the functions
if found and ENABLE_NLS is set to ON; for rare cases where their use is
unwanted, one could set CMAKE_DISABLE_FIND_PACKAGE_Intl to ON.

* Don't install/use gettext from Homebrew for universal Mac builds

Homebrew doesn't support universal libraries/binaries, hence only an unsuitable
pure-arm64 library is being installed, leading to build failure as a result.

Since it seems that gettext is still being installed as a dependency for some
other package(s), pass CMAKE_DISABLE_FIND_PACKAGE_Intl to guarantee it's not
being used.
2025-05-02 14:31:58 +01:00
Yat Ho
9e15394c65 refactor: announcer code housekeeping (#7496)
* refactor: use time_t for intervals

* refactor: use appropriate int types

* chore: housekeeping

* perf: replace count with find so it can short circuit

* code review: fix regression noticed by nevack
2025-05-01 17:50:14 +01:00
Yat Ho
03c2dbd63c feat: make proxy_url nullable (#7486)
* fix: clang-tidy warning

* refactor: make `proxy_url` nullable
2025-05-01 16:57:46 +01: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
10e7f10d26 chore: bump libevent (#7578) 2025-05-01 14:44:37 +01:00
Yat Ho
3312392c60 docs: use Qt6 in Windows build instructions (#7549)
* docs: use Qt6 in Windows build instructions

* docs: document `USE_QT_VERSION`
2025-05-01 12:42:24 +01:00
uglygus
1970becfbf Google-Glasnost was shut down in 2017 (#7555) 2025-05-01 12:36:56 +01:00
Yat Ho
0659f50373 chore: bump libnatpmp (#7536) 2025-05-01 11:53:38 +01:00
Yat Ho
e42bac88a6 chore: bump dht (#7577) 2025-05-01 11:24:19 +01:00
Yat Ho
7a094006fb chore: bump googletest (#7538) 2025-05-01 04:48:04 +01:00
Yat Ho
0a6c123fb7 chore: bump libpsl (#7575) 2025-05-01 02:06:25 +01:00
Yat Ho
67762b9eb5 chore: bump cmake_minimum_required to 3.16.3 (#7576)
* chore: bump cmake_minimum_required to 3.16.3 to match wide_integer

* build: unwrap CMP0092 from if

It was added in CMake 3.14
2025-05-01 02:03:46 +01:00
Yat Ho
90d71d928d chore: bump rapidjson (#7537) 2025-04-30 23:29:33 +01:00
Charles Kerr
ac5c9e082d chore: bump transmission 4.1.0 beta.2 (#7484)
* chore: bump to Transmission 4.1.0-beta.2

* docs: add release notes for 4.1.0-beta.2

* docs: update release notes

* docs: update release notes
4.1.0-beta.2
2025-03-10 18:05:53 -05:00
Alexander Terentyev
2c5b7f94d1 feat: proxy support for web-connections (#5038)
* feature: proxy support for web-connections

* forgotten changes

* fix code-styles

* –Documentation for new setting "proxy-url"

* Create property proxyUrl for class tr_web. Lazy creation of tr_web object in tr_session after loaded settings from file

* Update docs/Editing-Configuration-Files.md

Simplify the documentation text

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>

* Fix merge error

* Fix merge error.

* Simplify tr_web's lifecycle. Fix error. Rename quark to sneak_case-style

* Fix parameter value test

---------

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-10 17:32:18 -05: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
200af70762 refactor: use new tr_variant API for resume (#7069)
* refactor: use new `tr_variant` API to save resume file

* refactor: use new `tr_variant` API to load resume file

* chore: rename functions to `snake_case`

* chore: update comments

* perf: short circuit loading `3.00` progress

* refactor: changed `MaxRememberedPeers` to unsigned type
2025-03-10 16:19:16 -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
Charles Kerr
40d73978f7 chore: update generated web files 2025-03-10 16:03:30 -05:00
Charles Kerr
76d854dcc8 fix: clang-tidy-20 warnings (#7479)
* chore: disable unavoidable warning

* fix: clang-tidy readability-math-missing-parentheses warnings

* fix: clang-tidy google-readability-todo warnings

* fix: clang-tidy misc-use-internal-linkage warnings

* fix: clang-tidy readability-redundant-string-cstr warnings

* chore: disable cppcoreguidelines-avoid-const-or-ref-data-members warnings in tests

* chore: disable cppcoreguidelines-avoid-const-or-ref-data-members warnings in qt/

* fix: clang-tidy readability-identifier-naming warnings
2025-03-10 15:01:31 -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
24f58f70ee feat: sequential download in settings.json torrent-add and sesssion-* RPC methods (#7047)
* feat: init sequential download setting from ctor

* feat: `sequantialDownload` arg in `torrent-add` RPC method

* feat: sequential download settings in settings.json

* feat: sequential download arguments in `session-*` RPC methods

* test: fix
2025-03-10 12:07:35 -05:00
Yat Ho
04769d9986 feat: support trackers with only old BEP-7 support (#7481)
* feat: restore old BEP-7 query parameters

* fix: treat failed tracker response as failure
2025-03-10 11:07:15 -05:00
Yat Ho
40814a3195 refactor: save outgoing len(PadA), len(PadB) and len(IA) (#6973)
* refactor: save length of PadA and PadB sent

* refactor: log outgoing `len(PadA)` and `len(PadB)`

* refactor: set `ia_len_` as the MSE handshake initiator
2025-03-10 11:06:42 -05:00
Yat Ho
088232f69c fix: abort handshake if the torrent is stopped (#6947)
* fix: abort handshake if torrent isn't running

* fix: check if torrent is running in all cases

* fix: don't penalise peer if handshake failed because of us

* fix: tests

* perf: ensure copy-elision in `HandshakeMediator::torrent()`

* code review: more accurate log wording
2025-03-10 01:05:16 -05:00
Bheesham Persaud
1232f558a6 fix(remote): failure reason should be printed (#7034)
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
2025-03-10 01:04:10 -05:00
Yat Ho
49e0e59763 refactor: respond immediately to block requests from peer (#7029)
* refactor: respond immediately to block requests from peer

* refactor: extract `fill_output_buffer()` impl method
2025-03-09 19:45:08 -05:00
Yat Ho
47eb4ee2bc refactor: dedicated class for torrent queue (#7332)
* Revert "feat: save queue order between sessions (#6753)"

This reverts commit 4db50dae10.

* refactor: new torrent queue class

* refactor: replace queue code with new class

* test: new tests for new class

* feat: store and load queue order across sessions

* build: xcode

* refactor: use set_difference instead of unordered_set

* code review: use `tr_torrent_id_t` as key

* fix: don't overflow when moving up/down

---------

Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>
2025-03-09 19:08:50 -05:00
cdowen
4e7fc81975 feat: disconnect blocklisted peers on blocklist update (#7167)
* Fix: disconnect blocklisted peer on blocklist update.

Mark peer to be disconnected upon blocklist update.
Tested on my torrent, seems to be working.

Fix #732 .

* Add debug message when blocking peers

Add debug message each time a peer gets blocked during blocklist update.

* Change log api

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

---------

Co-authored-by: Yat Ho <lagoho7@gmail.com>
2025-03-09 18:33:09 -05:00
Mike Gelfand
42ccb54c98 Sync translations (#7477)
* Sync translations with code

* Sync translations with Transifex

* Fix order of plurals for Slovenian

* Add new Mac translations

* Afrikaans (af)
* Greek (el)
2025-03-09 13:47:57 +00:00
Yat Ho
1054ba4ab6 refactor: store peers as benc in resume file (#6892)
* refactor: add `tr_pex::to/from_variant()`

* refactor: store peers as benc in resume

* fix: discard invalid pex in `tr_pex::from_variant()`

* fix: limit number of peers loaded from resume
2025-03-08 12:19:18 -06:00
Charles Kerr
c398bd26f3 build: remove the test to see if curl is at least 7.15.6 (#7462)
CMakeLists.txt requires curl >= 7.28.0, so we do not need to test this.
2025-03-05 14:35:31 -06:00
Charles Kerr
ea2cac2335 refactor: simplify TR_CONSTEXPR20 macro (#7471) 2025-03-05 11:55:04 -06:00
Charles Kerr
642043861d refactor: remove unused macro TR_UNREACHABLE (#7470)
last use was removed in 3008a99
2025-03-05 10:36:06 -06:00
Charles Kerr
2c0b29143a refactor: remove TR_LIKELY and TR_UNLIKELY macros (#7469)
* refactor: remove unused TR_UNLIKELY macro

* refactor: remove TR_LIKELY from assertion macro

https://blog.aaronballman.com/2020/08/dont-use-the-likely-or-unlikely-attributes/

* refactor: remove unuse TR_LIKELY macro

* refactor: remove unused TR_GNUC_CHECK_VERSION macro

* refactor: remove unused __has_builtin fallback macro
2025-03-05 08:41:22 -06:00
Rukario
9ea7153ee4 feat: error rename alert message (#7394) 2025-03-04 19:29:52 -06:00
Charles Kerr
491cdc1560 refactor: remove TR_ARG_TUPLE macro (#7468) 2025-03-04 19:06:12 -06:00
Yat Ho
8c18cf4245 fix: use message id to check for pex and metadata xfer support (#7177)
* refactor: use metadata id to check for ut metadata support

* refactor: use pex id to check for ut pex support

* refactor: start pex timer after ltep handshake

* refactor: harden metadata xfer sanity checks

* code review: constexpr

* code review: don't save peer ut_pex_id and ut_metadata_id if on private torrent
2025-03-04 18:42:26 -06:00
Charles Kerr
0518a2269e fix: do not mark Variant::make_map() as noexcept (#7466) 2025-03-04 18:42:08 -06:00
Charles Kerr
cbd65ae8b1 refactor: fix modernize-use-nodiscard warnings by adding [[nodiscard]] (#7351) 2025-03-04 17:28:33 -06:00
Charles Kerr
de782e4315 ci: use Ubuntu 22.04 runner instead of Ubuntu 20.04 runner (#7465)
the latter is deprecated; see https://github.com/actions/runner-images/issues/11101
2025-03-04 11:12:51 -06:00
Rukario
43577e3df2 refactor: drop className .full in favor of :not(.compact) (#7354) 2025-03-04 08:21:23 -06:00