Commit Graph

16173 Commits

Author SHA1 Message Date
Yat Ho e1c9fbde60
fix: restore loose data type parsing in RPC and `settings.json` (#6723)
* refactor: incorporate lenient parsing from `tr_variantGet*()` functions into `tr_variant`

* fix: restore loose data types in RPC and settings.json

* fix: workaround GCC defect

* fix: MSVC build
2024-03-31 14:06:36 -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
Yat Ho 6384abeb2b
fix: invalid socket address in `tr_peerIo::reconnect()` (#6750)
* fix: don't discard socket if reconnect failed

* fix: don't try to reconnect more than once
2024-03-30 15:26:55 -05:00
Charles Kerr d935d364ed
refactor: remove torrent_view virtual class (#6738)
* refactor: remove torrent_view virtual class

* chore: workaround for google-readability-todo warnings

* chore: fix completion tests
2024-03-30 14:45:00 -05:00
Yat Ho 8944e587f9
fix: assert failure when moving torrents to bottom of the queue (#6751) 2024-03-30 13:49:03 -05:00
Cœur bc7d447949
fix shadowed declaration warnings [-Wshadow] (#6759) 2024-03-30 12:56:48 -05:00
Cœur 465b878e8a
Win32 compatibility for get_peer_stats (#6743) 2024-03-28 09:40:08 +00:00
Yat Ho 2ff3ae07d1
fix: more misc `net.cc` fixes (#6735)
* feat: accept ipv6 string in square brackets for `tr_address::from_string()`

* test: add test case for ipv6 string in square brackets

* fix: include square brackets in host component

According to RFC3986:
  host       = IP-literal / IPv4address / reg-name
  IP-literal = "[" ( IPv6address / IPvFuture  ) "]"

* fix: set ipv6-only socket before binding UDP socket

Will return EINVAL on Linux otherwise

* refactor: simplify code using `evutil` when binding TCP socket

* fix: do not set SO_REUSEADDR for listening sockets on Windows systems

Reason: https://stackoverflow.com/a/14388707/11390656

* fix: do not enclose ipv4 address string in square brackets
2024-03-25 21:10:06 -05:00
Cœur 2917374159
add macos-11 to actions.yml (#6617) 2024-03-25 20:46:11 -05:00
Yat Ho 1568659f95
fix: mismatched `class` forward declaration for `struct tr_peer` (#6725) 2024-03-25 12:00:26 -05:00
Yat Ho c223c70644
fix: potential nullptr deference in rpc (#6734) 2024-03-25 09:55:45 -05:00
Charles Kerr b318bf8d9d
refactor: use fstream in subprocess tests (#6733) 2024-03-25 09:13:09 -05:00
Cœur 4ce8a02916
Disable a long-lived and recurrent flaky test (#6722) 2024-03-25 00:32:29 -05:00
Yat Ho 3e958cfbaf
feat: µTP delayed ack (#6586)
* chore: rename tr utp functions to snake_case

* refactor: make udp sockets non-blocking

* feat: rudimentary uTP delayed ACK

* chore: housekeeping

* chore: correct comment about µTP packet format
2024-03-24 20:48:23 -05:00
Yat Ho 20aef2f79d
fix: misc net.cc and blocklist.cc fixes (#6717)
* fix: `tr_address` should be invalid by default

* fix: allow loopback address for LPD and incoming connections

* fix: `parseCidrline()` should set address type

* code review: keep `memcmp`
2024-03-24 17:09:51 -05:00
Cœur 9ddf609d50
KeepEmptyLinesAtTheStartOfBlocks: false (#6726) 2024-03-24 11:25:00 -05:00
Niccolò Maggioni 86498a71e5
feat: add torrent priority to completion script env vars (#6629) 2024-03-17 19:43:08 -05:00
Yat Ho 2548dd478f
feat: periodically refresh dht node id (#6695) 2024-03-17 18:24:36 -05:00
Cœur 1edd9193a3
bumping libdeflate/small/utfcpp to newer versions (#6709)
* bumping small from 0.2.0 to 0.2.1
bumping libdeflate from 1.18 to 1.19
bumping utfcpp from 3.2.1 to 4.0.5

* rolling back `small` to allow building on NetBSD/amd64.

* keeping submodules on Transmission forks

* bumping `small` to allow building on NetBSD/amd64.
2024-03-17 17:28:47 -05:00
Cœur c63c66c737
fix: Sparkle Version Comparator (#5263)
* fix: Sparkle Version Comparator

* Code review: Reducing CFBundleVersion to three components and avoiding versionComparatorForUpdater

* adding +99 when it's a non-beta release

* code review: set CFBUNDLE_VERSION and unset components

* re-adding support for ignoring beta
2024-03-17 16:23:39 -05:00
Cœur 0749300090
bumping googletest from 1.11.0 to 1.14.0 (#6702)
* bumping googletest from 1.11.0 to 1.14.0

* logging ::testing::TempDir()

* sandboxing ::testing::TempDir()
2024-03-17 15:13:56 -05:00
Yat Ho 0c466b4137
ci: trigger CI when changing CI definitions (#6688)
* fix: build tests for `ubuntu-20-04-from-tarball`

* fix: build tests for `macos-12`

* feat: build apps when `actions.yml` changed

* Revert "fix: build tests for `ubuntu-20-04-from-tarball`"

This reverts commit 2925e9fa72.
2024-03-16 13:17:31 -05:00
Charles Kerr 11b794e656
refactor: allow Settings to register custom serializers / deserializers (#6667) 2024-03-15 23:27:55 -05:00
Yat Ho 152f3e91a5
refactor: convert `tr_peerMsgsImpl` helper functions to class methods (#6580)
* refactor: update bep links

* chore: use more appropriate data types

* chore: checkpoint

* refactor: split `can_request()` into each of their own different signature

* chore: checkpoint

* refactor: convert tr_peerMsgsImpl functions to methods

* chore: checkpoint

* refactor: store peer info as reference

* refactor: convert all member variables to private

* chore: re-arrange methods

* refactor: optimise tmp vector default size in `send_ut_pex()`

* chore: housekeeping

* chore: housekeeping

* refactor: avoid `dynamic_cast` when sending cancel

* fix: restore `blocks_sent_to_peer` stat

regression e91af26923

* fix: choke first then reject

* refactor: convert `tr_peerMsgsNew()` to static factory function

* refactor: store `tr_torrent` reference instead of pointer

* Revert "refactor: store peer info as reference"

This reverts commit bb419bf2

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-03-15 19:52:09 -05:00
Cœur 8709ec60e6
run peerMgrPeerStats in session thread (#5992)
* run peerMgrPeerStats in session thread

* code-review: add a TODO: for refactoring
2024-03-15 19:04:43 -05:00
Cœur a72a93764e
deps: update miniupnp to 2.3.4 (miniupnpc 2.2.6) (#6459)
* refactor: add miniupnp 2.3.0 as a submodule

* refactor: remove miniupnpc submodule

* deps: specify the 2.3.0 branch

* build: point to miniupnp monorepo subdirectory miniupnpc

* Fix building miniupnp from Xcode

* fixed miniupnp updateminiupnpcstrings.sh usage

* updating to miniupnpc 2.2.6

* fix build for Windows

* code review: removing the header move

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-03-15 18:19:51 -05:00
Cœur e9d16387ae
fix multipleRatioLimits (#6698)
* fix multipleRatioLimits

* fix building on macOS 11
2024-03-15 17:45:31 -05:00
Cœur 6a9727efc7
build: run sanitizer-tests on macOS in CI 2024-03-15 17:18:27 -05:00
Cœur edc59ba5d8
fix compatibility with clang-format 18 (#6690)
* fix clang-format

* compatibility with clang-format 17-18
2024-03-15 00:17:10 -05:00
Dzmitry Neviadomski 8e35e526c6
chore: fix warnings when compiling macOS client with either Xcode or CMake (#6676)
* chore: fix CGFloat comparison warnings in macOS code.

There are 2 cases:
 1. Speed comparisons.
    The lowest significant value displayed in UI is 0.1 bytes per sec.
    See [NSString stringForSpeed] and [NSString stringForSpeedCompact].
 2. Ratio limit comparison.
    The lowest significant value displayed in UI is 0.01 (no unit).
    This is based on maximumFractionDigits=2 set in related XIB file.

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

* chore: fix warning about shadowed variable

CGFloat const difference was used twice in the same scope

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

* chore: fix unused block parameter warnings

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

* chore: disable GCC_WARN_64_TO_32_BIT_CONVERSION for libtransmission

This warnings are not reported with CMake build.

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

* chore: disable CLANG_WARN_STRICT_PROTOTYPES for dht

This is third party target, warning is not enabled with CMake build.

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

* chore: disable '-Wexit-time-destructors' warning with CMake.

There are two cases when this is reported in libtransmission:
1. `log_state` in anonymous namespace in `log.cc`.
2. static inline `dh_pool_mutex` in `tr_handshake` in `handshake.h`.

I don't see how this may be improved or how this affects correctness,
so don't nag about that.

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

---------

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
2024-03-15 00:16:26 -05:00
Gary Elshaw 45d3c678bc
feat: webui use monochrome icons for play/pause buttons (#5868) 2024-03-15 00:15:01 -05:00
Gary Elshaw 5ad6b98c7c
docs: update AUTHORS (#6696) 2024-03-14 22:46:54 -05:00
Mike Gelfand 991b0f0d3d
Support WiX toolset versions other than 3.11 (#6689)
Version 3.14 was recently released with security fixes, and GitHub
runners have been updated to use it. Don't hardcode the version in
Program Files directory name to support any 3.x. Since 3.x support will
be dropped within a year, need to plan migration to 5.x when it's
released (4.x isn't suitable because of missing heat replacement).
2024-03-13 16:40:41 +03:00
Cœur 6909ec0bad
build: fix building on macOS 10.14.6, 10.15.7 and 11.7 (#6590) 2024-03-09 10:27:20 -06:00
Hendrik Luup 6a212e7e8e
fix(web): do not close all popups on successful rpc requests (#6675)
Fixes regression introduced in 250f43ae
2024-03-09 09:34:44 -06:00
Yat Ho 5d159e0ee5
docs: fix `torrent-get` `fileStats` and `wanted` docs (#6677)
* docs: fix `torrent-get.wanted` and `torrent-get.fileStats.wanted` docs

* fixup! docs: fix `torrent-get.wanted` and `torrent-get.fileStats.wanted` docs

* docs: add note to differentiate `torrent-get.wanted` and `torrent-get.fileStats.wanted`
2024-03-09 09:05:00 -06:00
Yat Ho 33898b002d
chore: bump small (#6669) 2024-03-08 15:36:50 -06:00
Mike Gelfand 52d1c1f34b
Support CMake 3.28+ in CI jobs on Windows (#6668)
* Support building Qt using CMake 3.28+

CMake 3.28 dropped support for deriving installation prefix(es) based on
PATH environment variable on Windows. Since all the other built packages
already pass necessary prefix path(s) explicitly via CMAKE_PREFIX_PATH
and it works for them, do the same for Qt 6 as well. Building Qt 5 isn't
affected as it doesn't use CMake.

* Fix environment variable name in `windows` build job

Using wrong name resulted in empty `CMAKE_PREFIX_PATH` CMake setting
value, which showed the effects of CMake 3.28 changes yet again.
2024-03-05 02:53:59 +00:00
Hendrik Luup 34b8c827a8
refactor(web): use crypto.randomUUID for UUID if available (#6649)
crypto.randomUUID() is the most up to date way to generate UUIDs.
It works in secure context (HTTPS) and for localhost.
https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID

It has a wide browser support, but we are keeping the fallback
for older browsers and for cases where users are using a custom
hostname without HTTPS, that's not consider a secure context.
https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
2024-03-04 18:16:31 -06:00
Cœur 04956c35b4
build: target clang-format version 17 (#6631) 2024-03-04 17:49:39 -06:00
Charles Kerr 50dca24f50
refactor: aggregate crypto handles when computing digests (#6662)
* refactor: aggregate per-crypto-pkg fields instead of using inheritance
2024-03-04 16:59:51 -06:00
Hendrik Luup 98c4eb8487
refactor(web): extract mime icon creation to the helper (#6664) 2024-03-04 08:46:25 -06:00
Yat Ho 7a4677ebd2
ci: bump CI actions (#6666)
* chore: bump `peter-evans/create-pull-request`

* chore: bump `actions/checkout`

Breaking changes:
- Bump Node.js runtime to version 20

* chore: bump `actions/*-artifact`

Breaking changes: See https://github.com/actions/download-artifact/releases/tag/v4.0.0

* chore: bump `actions/cache`

Breaking changes:
- Bump Node.js runtime to version 20

* chore: bump `actions/setup-java`

Breaking changes:
- Bump Node.js runtime to version 20

* chore: bump `gradle/gradle-build-action`

Breaking changes:
- Remove the gradle-executable input parameter

* chore: trigger CI

* Revert "chore: trigger CI"

This reverts commit 9f9987f201.
2024-03-04 08:45:37 -06:00
Charles Kerr efd6790973
refactor: remove tr_sys_file_flush() (#6647) 2024-03-03 23:29:38 -06:00
Hendrik Luup 250f43ae68
fix(web): close connection failed alert on successful request (#6657) 2024-03-03 21:00:44 -06:00
Hendrik Luup dc1dc5b6b0
refactor(web): Remove unused functions from utils.js (#6656)
* refactor(web): remove unused createTabsContainer function

```console
$ grep -nr createTabsContainer src/
src/utils.js:85:export function createTabsContainer(id, tabs, callback) {
```

* refactor(web): remove unused setChecked function

```console
$ grep -nr setChecked src/
src/utils.js:213:export function setChecked(element, b) {
```
2024-03-02 21:34:44 -06: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
Cœur 7f029acf6e
remove duplicate path: Transmission.xcodeproj (#6625) 2024-02-19 00:11:34 -06:00
Charles Kerr a90d0fce2b
refactor: inline simple getters in qt client (#6621)
* refactor: make RpcClient::url() constexpr

* refactor: make Session::getRemoteUrl() constexpr

* refactor: make RpcQueue::setTolerateErrors() constexpr

* refactor: make RpcClient::isLocal() constexpr

* refactor: make Session::isLocal() constexpr

* refactor: make Session::isServer() constexpr

* refactor: make PathButton::label() constexpr

* chore: remove accidentally-committed makelog file
2024-02-18 18:48:27 -06:00
Charles Kerr b1b685af3f
refactor: make tr_torrentReqIsValid() private (#6620) 2024-02-18 16:00:13 -06:00