Commit Graph

16149 Commits

Author SHA1 Message Date
Yat Ho 45696b60d2
fix: `settings.json` default value and docs (#7044)
* docs: fix `message-level` default

* docs: fix `peer-socket-tos` description

* fix: restore `rename-partial-files` default value
2024-08-13 00:47:34 +01:00
Yat Ho 120b2fb6a0
chore: misc formatting updates and fixes (#7049)
* chore: remove redundant `.clang-format` entry for `TR_DEFINE_QUARK`

Left-over from bf41e1487a.

* chore: remove redundant `.clang-format` entry for `API_HEADER_*`

Left-over from f7edcfcb2a.

* chore: drop deprecated options in favour of `PackConstructorInitializers`

* fix: invalid `SpacesInAngles` value

* chore: add comment to forecast a change we need to make in the future

* chore: add trailing comma to prettify lambda
2024-08-13 00:44:39 +01:00
Jason Beck 3e9f5f614a
fix: Qt build missing an icon (#6683)
* Create a new shared location for icons and update qt scripts to package public icons

* Move the Faenza.qrc back to original location

* Revert "Move the Faenza.qrc back to original location"

This reverts commit 963e099d65.

* Replace Faenza to its original location

* Remove attribution for an image that does not exist
2024-07-18 02:12:18 +01:00
Yat Ho fa8be1b981
fix: `tr_variant_serde::parse_json()` bug fixes (#6901)
* perf: avoid unnecessary copying

* fix: set `tr_variant_serde::end_` in `parse_json()`

* test: `tr_variant_serde::end()`

* fix: compensate for innate read cursor offset of `rapidjson::AutoUTFInputStream`

* fix: stop parsing json after parsing a complete json root

This matches the benc parser's behaviour

* fixup! fix: stop parsing json after parsing a complete json root
2024-07-17 02:34:13 +01:00
Mike Gelfand c21ee87eea
Add CI configuration for clang-tidy on Windows (#6997)
* Add CI configuration for clang-tidy on Windows

* Fix issues reported by clang-tidy on Windows

* Workaround clang-tidy defects on Windows

* Fix C-style casts (which clang-tidy didn't report)
2024-07-16 22:13:29 +01:00
Yat Ho e334f3c37f
fix: misc µTP trace log fixes (#6929)
* fix: FTBFS when `TR_UTP_TRACE` is defined

* refactor: log socket address when processing udp packets

* refactor: log details of unexpected UDP packet

* fix: don't unset utp context userdata during shutdown

It is still needed inside `utp_destroy()` when `UTP_DEBUG_LOGGING` is defined.

* code review: lazy evaluate incoming udp packet display name

* code review: move `from_str` out of loop
2024-07-14 11:55:37 +01:00
Yat Ho a92fc3b76e
fix: loading `2.20-3.00` progress from resume (#6896)
* fix: loading `2.20-3.00` progress from resume

* code review: fix always 0
2024-07-14 08:37:43 +01:00
Yat Ho a76a07ae99
chore: misc code cleanups (#6927)
* refactor: avoid repeated subscripting in `announcer-udp.cc`

* chore: remove redundant locking in global ip cache

* chore: misc code cleanup in global ip cache

* fixup! chore: misc code cleanup in global ip cache

* refactor: remove `tr_global_ip_cache::create()`

* refactor: rename `tr_global_ip_cache` to `tr_ip_cache`

* build: sync changes to xcode
2024-07-14 01:37:55 +01:00
T Reardon 7f79cb16ee
chore: clarify DhtPort specific usage (#6963) 2024-07-11 01:42:47 +01:00
Yat Ho 415c0a8aa3
fix: apply alt speed settings on load (#6937)
* fix: apply alt speed settings on load

* refactor: allow forcing `tr_session_alt_speeds::set_active()`
2024-07-11 00:55:34 +01:00
Yat Ho 5e08164742
fix: crash in `tr_torrent::VerifyMediator::on_verify_done()` (#6918)
The crash will happen if the following series of events happened:
1. Torrent verification starts for a `tr_torrent` object.
2. The session thread starts executing `tr_torrentFreeInSessionThread()`, about to free this `tr_torrent` object.
3. `tr_torrent::VerifyMediator::on_verify_done()` queues a lambda that captures a pointer to the `tr_torrent` object.
4. The `tr_torrent` object is freed.
5. The session thread executes the lambda from Step 3, and crashes when dereferencing the dangling `tr_torrent` pointer.
2024-07-10 23:48:54 +01:00
reardonia 24f1e15767
refactor: clarify MSE crypto algo. this is a per-algorithm key, not for crypto generally (#6957)
Co-authored-by: TR Reardon <reardonia@github.com>
2024-07-06 23:25:15 -05:00
Torbjörn Lönnemark ec5296c8dc
fix: restore tr_optind in all getConfigDir branches (#6920)
When the --config-dir/-g option was passed, this bug caused all options
preceeding it on the command line to be ignored.

Also remove the superfluous break statement.

Regression introduced by e49747ab51.
2024-06-15 21:57:46 +01:00
Yat Ho 0f1aaf11e0
docs: fix default value in docs (#6919) 2024-06-15 21:57:22 +01:00
Yat Ho 1f10c50979
ci: bump `clang-tidy` from 14 to 18 (#6923)
* ci: bump `clang-tidy` from 14 to 18

`clang-tidy-14` has been crashing when being run on `peer-mgr.cc` since 96de1706af.

According to https://github.com/llvm/llvm-project/issues/95631, upgrading to `clang-tidy-18` fixes this.

* chore: workaround clang-tidy false positives

* fix: limit nolint comment scope

* code review: try avoiding false positive without nolint
2024-06-15 21:06:37 +01:00
Cœur febfe49ca3
bump miniupnpc to 2.2.8 (#6907)
* bump miniupnpc to 2.2.8

* Avoid build error "ln: include/miniupnpc/.: Operation not permitted"
2024-06-15 00:24:06 +01:00
Cœur ec6112e0b1
fix compile error: no matching function for call to ‘flock::flock‘ (#6908)
* fix compile error with gcc 8.2: no matching function for call to ‘flock::flock(tr_sys_file_t&, const int&)

* #error temp checking which pipelines have XFS

* code review: removing duplicate include

---------

Co-authored-by: yunhai <haihai107@126.com>
2024-06-12 02:34:47 +01:00
niol d42d0f3f3f
build with -latomic on platforms that need it (#6774) 2024-06-04 21:59:13 +01:00
Dzmitry Neviadomski b565e076a9
chore: update older macos build verification workflow to macos-12 (#6883)
* chore: update older macos build verification workflow to macos-12

Manually set Xcode to the version was used in macos-11 runner.

See:
https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode
https://github.com/actions/runner-images/blob/main/images/macos/macos-11-Readme.md#xcode

* chore: re-enable macos-12 build verification action

* chore: disable gtk and qt clients explicitly with macos build verification

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
2024-06-03 21:47:51 +01:00
Cœur 489de60222
Remove warning "don't cut off end" (#6890) 2024-06-03 21:46:15 +01:00
Yat Ho 2c2011d40f
fix: update partial file suffix after verifying torrent (#6871)
* fix: only update piece completion if different

* fix: remove return statement from void function

* refactor: add `tr_torrent::has_file()`

* fix: update file suffixes after verifying torrent

* fix: tests
2024-06-01 19:44:01 -05:00
Cœur acee39e15c
refactor: harden idle_seconds (#6834)
* Hardening idle_seconds

* code review: revert "size_t to time_t" because time_t isn't guaranted to be signed in the C spec
2024-06-01 17:41:44 -05:00
Yat Ho 78027a8e5b
refactor: cleanup build for miniupnp (#6665)
* fix: remove redundant/outdated miniupnp cmake definitions

* refactor: simplify miniupnpc includes

* fix path to miniupnp

* fix: Xcode project

* fixup! fix: Xcode project

* code review: Xcode changes from mikedld

* refactor: drop miniupnpc support below `1.7`
2024-06-01 20:10:52 +01:00
Yat Ho efec65050e
fix: don't call `tr_logAddTraceIo` before `tr_peerIo::set_socket()` (#6881)
* fix: add fallback for invalid address display name

* fix: only call tr_logAddTraceIo after `tr_peerIo::set_socket()` is called

* chore: housekeeping

* code review: handle `nullptr` from `inet_ntop()` instead

* code review: remove unclear comment

* code review: dedupe peerIo bandwidth log
2024-06-01 16:23:46 +01:00
Laura Kirsch f3f887c93e
libtransmission: fix copyright header generation (#6874)
This is related to #4850 since libtransmission/mime-types.js generates
libtransmission/mime-types.h and puts it there.
Also add a note that the file is automatically generated for good measure.
2024-06-01 15:39:33 +01:00
Charles Kerr 2b75869c80
fix: cert-err58 warning in declaration of TrayIconName, AppIconName, AppName (#6861) 2024-06-01 10:50:51 +01:00
Yat Ho a18fca5950
fix: reset wishlist when stopping torrent (#6869) 2024-05-29 14:35:07 -05:00
github-actions[bot] d467fa1f7f
chore: update generated transmission-web files (#6865)
Co-authored-by: ckerr <70381+ckerr@users.noreply.github.com>
2024-05-27 20:16:23 -05:00
niol 63e74f4df8
webui: enable click to hide inspector (#6863) 2024-05-27 20:12:43 -05:00
Charles Kerr 6132706565
chore: iwyu (#6864)
* chore: do not include <set> unless we use it

* chore: do not include <map> unless we use it

* chore: do not include <string> unless we use it

* chore: do not include <list> unless we use it

* chore: do not include <memory> unless we use it

* chore: do not include <optional> unless we use it

* chore: do not include <functional> unless we use it
2024-05-27 17:36:02 -05:00
Luukas Pörtfors 88d280be8f
feat(remote): implement idle seeding limits (#2947) 2024-05-27 15:08:33 -05:00
Yat Ho 96de1706af
perf: restore 3.00 peer info (atom) pool pruning (#6712)
* refactor: remove inactive peer info housekeeping

* refactor: restore atom pulse (now peer info pulse)

* refactor: don't hard cap peer info limit
2024-05-26 16:34:26 -05:00
Yat Ho 4657d210ba
feat: dual stack udp tracker support (#6687)
* chore: housekeeping

* refactor: reduce copying when building payloads

* feat: dual-stack udp tracker support

* refactor: convert function names to snake_case

* fix: `readability-identifier-naming` warning

* fix: account for dual-stack in tests

* code review: add prefix to global names

* fix: don't resolve to IPv4-mapped address

* refactor: use `tr_address` method to check ip protocol

* fix: workaround MSVC x86 build failure

* fix: handle host components that has square brackets

* Partial Revert: "fix: account for dual-stack in tests"

Not needed anymore

* fix: store ipv6 peers in pex6

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-05-26 15:43:55 -05:00
Yat Ho 3677e7a591
chore: resume file remove redundant `have` key and other cleanup (#6747)
* fix: don't save blocks bitfield to resume when we are seed

* chore: housekeeping

* code review: replace `auto` with `tr_resume::fields_t`

* code review: remove the `have` key in resume

* fix: `blocks` error message
2024-05-26 13:02:42 -05:00
Yat Ho d6f5e60a35
feat: ipv6 lpd (#6700)
* feat: ipv6 lpd

* feat: find interface index from ip address

* refactor: use `tr_socket_address::from_string()`

* fix: enable multicast loop

* chore: housekeeping

* refactor: dedupe `if_nametoindex()` call

* refactor: rename `mcast_socket_` to `mcast_sockets_`

* code review: fix variable name typo

* code review: unify comment styles

* fixup! code review: unify comment styles

* code review: explain 15KB in Win32 interface index code
2024-05-26 00:04:50 -05:00
Yat Ho 5f091fac18
refactor: store peer info objects in shared pointers (#6614)
* chore: housekeeping

* refactor: store peer info objects in shared_ptr

* refactor: minimise insert/erase operations to the peer info pool

* refactor: unify `on_got_port()` exit point to simplify cleanup

* fix: use `std::unordered_map` as a stand-in for `small::map`

* refactor: use small maps but with `std::vector` as base

* fix: suppress goto warning

* refactor: use `small::map`

* fix: remove constexpr
2024-05-25 19:13:15 -05:00
Cœur 92478ec849
refactor: rename "UpdateQueue" to "UpdateTorrentsState" (#6613) 2024-05-25 18:43:08 -05:00
Cœur bf0119dd3f
Recommended Project Settings (#6591)
* Recommended Project Settings

* adding script inputs and outputs

* fix path to evconfig-private.h

* disabling sandboxing for retrieving the git commit hash

* Also Enable Parallelization in Command Line Builds Using '-target'.

* remove superfluous "per-target" settings

* fix settings.h explicit file type.

* fix path to miniupnp

* ensuring objectVersion = 51 in code_style.
2024-05-25 17:42:15 -05:00
Yat Ho 17c6ec755c
feat: allow port forwarding state to recover from error (#6718)
* feat: allow upnp to recover from errors

* feat: allow natpmp to recover from errors

* chore: housekeeping

* code review: explicitly list all states to start discovering from

* fix: recover from failed UPnP discovery

* refactor: remove `UpnpState::Failed`
2024-05-25 17:08:16 -05:00
Yat Ho edddf9d80e
fix: torrent details speed info unit (#6845) 2024-05-25 16:43:38 -05:00
Charles Kerr c465575dab
build: temporarily disable macos-11 sanity checks (#6858)
re-enable when brew is fixed
2024-05-25 15:59:52 -05:00
Dzmitry Neviadomski acd0c22a3d
refactor: add virtual destructor to the polymorphic Settings class (#6786)
Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
2024-05-25 15:20:40 -05:00
github-actions[bot] c2e12cbf52
chore: update generated transmission-web files (#6857)
Co-authored-by: ckerr <70381+ckerr@users.noreply.github.com>
2024-05-25 14:37:21 -05:00
Yat Ho 381c17e0bb
webui: fixed width for speed info (#6739)
* webui: fixed width for speed info

* fix: match download icon-text gap with upload

* webui: move speed arrow to the right of the text
2024-05-25 13:32:01 -05:00
orangepizza 8bb49e3fdf
fix: building with mbedtls 3.X (#6822)
uses renamed funtion name for mbedtls 3.x

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
2024-05-25 12:41:03 -05: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
Yat Ho 9748f42c5a
fix: restore portable file path check (#6853)
* chore: change to snake_case naming

* fix: restore portable file path check

* fix: macosx build
2024-05-25 10:08:53 -05:00
niol adc405e5be
fir scripts, document usage of systemd overrides rather than changing /lib files (#6800) 2024-05-24 15:52:10 -05:00
Dzmitry Neviadomski e8a72d9c5d
Default initialize sleep callback duration in tr_verify_worker (#6789)
std::chrono::duration is just a wrapper, underlying numerical value member will be default initialized to zero as expected.

See https://en.cppreference.com/w/cpp/chrono/duration

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
2024-05-24 15:51:16 -05:00
Yat Ho 09b67c84b1
fix: possible heap-use-after-free with magnet links (#6815)
* fix: queue torrent verification as soon as metadata complete

* fix: avoid heap-use-after-free in `tr_peerMsgsImpl::process_peer_message()`

Details: https://github.com/transmission/transmission/pull/6383#discussion_r1429202253

* code review: move `tr_torrent::do_magnet_idle_work()` to private

* code review: `std::deque::empty()` is not `constexpr`

* fix: test
2024-05-24 15:50:01 -05:00