Commit Graph

16149 Commits

Author SHA1 Message Date
Charles Kerr 5854b0ea90 ci: do not select Xcode 13.2.1
it is not available in macOS 13 runner

Xref: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode

Xref: https://github.com/transmission/transmission/pull/6883
2024-10-14 07:43:48 -05:00
Charles Kerr f0087d83da ci: replace macos-12 with macos-13 2024-10-14 07:43:48 -05:00
Charles Kerr 0f76fe1511 Revert "build: remove macos-12-x86_64-from-tarball from GitHub workflows"
This reverts commit 0b9da0aa28.
2024-10-14 07:43:48 -05:00
Charles Kerr 1612884d4b build: remove macos-12-x86_64-from-tarball from GitHub workflows 2024-10-14 07:43:48 -05:00
Yat Ho f37b8d9bf5
fixup! fix: update partial file suffix after verifying torrent (#6871) (#7072) 2024-10-14 07:43:18 -05:00
Yat Ho c7c8c47850
perf: don't open torrent file descriptors with `TR_SYS_FILE_SEQUENTIAL` (#7089) 2024-10-13 21:56:44 -05:00
Yat Ho 61ecad4c43
fix: update torrent progress when verifying partially completed pieces (#7143)
* fix: update torrent progress when verifying partially completed pieces

* chore: restrict scope of local variable
2024-10-13 19:15:21 -05:00
Cœur f5997eb5ed
remove TR_ASSERT(now >= latest) (#7018) 2024-10-13 14:34:45 -05:00
Yat Ho 21d7720749
refactor: improve criteria for choosing peers to save to resume (#6922)
* fix: only consider peers with listening ports interesting

It's a waste of space to store peers we cannot connect to (because we don't know what their listening port is).

* fix: don't consider peer as interesting just because we are currently connected to it

For example, it's possible for a peer to be "in-use" and "banned" at the same time, albeit just for a very short while.

* code review: assert that peer port is not empty
2024-10-13 13:48:49 -05:00
Yat Ho 4db50dae10
feat: save queue order between sessions (#6753)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-10-13 11:36:38 -05:00
Yat Ho 45f5a19950
fix: calculate size of one hash line in lpd correctly (#7136) 2024-10-13 08:36:32 -05:00
Etienne Dechamps 32cfd712d0
Clarify file order and indexes (#7120)
See the discussion in #5578. I don't think anyone would expect
otherwise, but it doesn't hurt to be explicit.
2024-10-13 08:35:32 -05:00
Etienne Dechamps f0af1fb0ab
Clarify that torrent ids are not stable (#7110)
Transmission renumbers torrents on restart. This may catch RPC clients
off-guard if the daemon happens to restart between two related RPCs.
2024-10-13 08:30:04 -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
Mike Gelfand f6e1bb2d70
GTK client accessibility improvements (#7119)
* Reformat GTK *.ui files

Remove useless comments since we're mostly editing those files by hand
now. Wrap multi-line text values in CDATA to avoid automated formatters
changing whitespace there in any way. Collapse empty elements.

* Switch from plain `GtkLabel`s to `GtkFrame`s for sections

Frames are reported as groupings by assistive technologies.

* Fix minor usability issues

* Make value labels labelled and selectable
2024-09-14 02:34:39 +01:00
Yat Ho 8b92f6d011
chore: remove unused `TR_KEY_show_extra_peer_details` app default (#7117) 2024-09-13 22:14:24 +01:00
Yat Ho d29d1fce5b
fix: use correct quark for `Prefs::SHOW_TRACKER_SCRAPES` (#7116) 2024-09-13 22:14:02 +01:00
Yat Ho 1593b993ad
chore: delete redundant `MainWindow.ui.full` (#7113) 2024-09-13 10:33:41 +01:00
Yat Ho 9ff95d162e
fix: various pex flag bugs and cleanup (#6917)
* fix: allow connection between seeds when pex is enabled

* chore: add comment to explain `tr_peerMsgs::on_torrent_got_metainfo()`

* refactor: remove `tr_swarm::mark_peer_as_seed()`

* fix: update seed flag in response to BT msgs

Regression from 81a42c6bb6

* chore: remove redundant code to update peer seed flag

* refactor: inc failure count if there were no piece data exchanged

* fix: save information from ltep handshake

* refactor: rename `tr_peerIo::is_seed_` to disambiguate

* fix: add instead of set pex flags when adding non-pex and non-resume peers

* fix: don't mark peer as connectable on getting ltep port msg

By BEP-11's definition, this flag is only set for peers whom we successfully initiated an outgoing connection with.

* refactor: set holepunch flag when we get it from ltep handshake

* fix: only accept positive `reqq` in ltep handshake

* refactor: handle encryption preference in `tr_peer_info`

* refactor: prefer own value for utp support

* refactor: make `tr_peer_info::from_first_` const

* refactor: handle holepunch support in `tr_peer_info`

* fix: parse metadata size only if we have a valid extention id for metadata xfer

* refactor: remove `tr_peer_info::add_pex_flags()` as it's no longer needed

* fix: correctly handle holepunch support when there is no `m` key in ltep handshake

* fix: distinguish between upload only and seed

Say we just connected to a partial seed, the peer sends an ltep handshake that has the `upload_only` key, then a BT `Bitfield` message:

Without this change, the pex seed flag would be set when parsing the ltep handshake, then immediately unset when parsing the `Bitfield` message.

We don't want that.

* fix: don't update `tr_peer_info::is_seed_` when merging peer info objects

* perf: priority in peer candidate score need 2 bits only

* fix: prefer to connect to downloading peers

Regression from c867f00153

* chore: add TODO for C++20 opportunity

* refactor: don't filter out peers without `ADDED_F_CONNECTABLE`

revert change from a2849219f7

* refactor: move peer state updates out of peermgr code

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-08 22:05:03 -05:00
Mike Gelfand 7c7046be6e
Fix infinite loop when searching for missing torrents by id (#7097) 2024-09-04 01:14:40 +01:00
Mike Gelfand 7e60fb87ab
Use "scale" cell renderer property to adjust file list font size (#7096)
Manually calculated font size needs to be recalculated (which we weren't
doing), otherwise leading to wrong size on global font size and/or scale
factor changes.

Simplify file list columns setup where possible.
2024-09-03 23:05:11 +01:00
Yat Ho 461e178c8f
fix: don't process http announce error if already succeeded (#7086) 2024-09-02 16:24:35 -05:00
Robin Seth Ekman 5260331732
build: enable clang-tidy by default (#4821) (#6989)
* build: enable clang-tidy by default (#4821)

* Apply suggestions from code review

* Disable clang-tidy for Android CI build
2024-08-26 00:11:37 +01:00
Yat Ho 1b57c294be
fix: process BT messages that immediately follows handshake (#6913)
* refactor: don't loop in `tr_handshake::can_read()`

* fix: return `READ_NOW` after handshake success

* code review: more accurate comment wording

* Revert "refactor: don't loop in `tr_handshake::can_read()`"

This reverts commit 4f33520cba.

* refactor: convert `ReadState` to enum class

* refactor: use new `ReadState` value to break out of loop
2024-08-24 17:04:28 -05:00
Yat Ho 34dbaaad7e
fix: add missing `write()` call in MSE handshake (#6891)
* refactor: tidy up variables in `tr_handshake::read_crypto_provide()`

* fix: make sure to send out `crypto_select`

* chore: fix comment

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-08-24 14:18:57 -05:00
Yat Ho b1a765459a
fix: limit number of bad pieces to accept from a webseed (#6875)
* perf: initialise blame bitfield by piece count

* refactor: set blame for all peers

* refactor: make `tr_swarm::add_strike()` work for all peers

* refactor: move `tr_peer::do_purge` to `tr_peerMsgs`

* fix: limit number of bad pieces to accept from a webseed
2024-08-24 14:18:12 -05:00
Mike Gelfand d8413493d0
Move Qt client's tr_main() into a separate file (#7076)
Support special (optional) `--` argument to explicitly separate options
from filenames. Support special `---` argument to separate client
arguments from Qt arguments.
2024-08-24 18:15:19 +01:00
T Reardon 7543126789
fix sort order of trackerStats keys within RPC doc (#6946)
* fix sort order of keys within trackerStats

* clarify crypto algo

* Revert "clarify crypto algo"

This reverts commit 25e9accb5f.

---------

Co-authored-by: TR Reardon <reardonia@github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-08-24 08:19:04 -05:00
Yat Ho 62240393ed
feat: configurable client `reqq` (#7030)
* chore: housekeeping

* refactor: raise client reqq value

* feat: allow configuring client reqq value

* feat: expose reqq config in RPC

* test: add new key

* code review: distinguish client vs peer

* docs: fix new config name

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-08-23 21:46:37 -05:00
Yat Ho b0a6bf964c
perf: lazy initialise Diffie-Hellman in handshake (#6949)
* perf: don't generate private key when default constructing DH

* refactor: simplify dh pool code using `small::max_size_vector`

* perf: lazy initialise handshake DH

* fix: tests

* refactor: use `std::optional` instead of `DH::is_dummy()`

* perf: try recycling DH objects in handshake destructor

* fix: don't set `have_read_anything_from_peer_` until all sanity checks are finished
2024-08-23 16:14:45 -05:00
Yat Ho b5b7d7abde
chore: misc WebUI fixes and cleanup (#7037)
* chore: housekeeping

* fix: use `setCurrentPopup` for drag and drop dialogue

* fix: minor typo

* chore: removed unused timer

* fix: correct value in `<input multiple='?'>`

* fixup! chore: housekeeping

* code review: use `URL.canParse()`

* Revert "code review: use `URL.canParse()`"

This reverts commit b1a436031a.
2024-08-23 15:16:22 -05:00
Cœur 07172d9f4f
refactor: avoid `front()` prior to loop (#7068)
* refactor: avoid `front()` prior to loop

* Update libtransmission/peer-mgr.cc

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

---------

Co-authored-by: Yat Ho <lagoho7@gmail.com>
2024-08-23 10:34:44 -05:00
Yat Ho 3e5a77d176
refactor: remove last byte special case in `tr_block_info::byte_loc()` (#7064)
* refactor: remove last byte special case in `tr_block_info::byte_loc()`

* fix: handle 0-byte file at the end of torrent in fpm

* test: modify test for 0-byte file at the end of torrent

* fix: handle 0-byte file at the end of torrent in `block_span_for_file`
2024-08-22 19:03:14 -05:00
Rukario 10333d23b2
fix: make name and hash readable (#7014) 2024-08-22 18:04:45 -05:00
Cœur d9d87eddd8
Bumping MACOSX_DEPLOYMENT_TARGET to 11.0 (#6911)
* Bumping MACOSX_DEPLOYMENT_TARGET to 11.0

* removing obsolete code and resources

* Add a build action for Transmission.xcodeproj

* removing obsolete code
2024-08-22 15:07:17 -05:00
Alessandro Astone 173c19eb5a
fix: Avoid ambiguous overload when calling Gdk::Cursor::create (#7070)
Since gtkmm 4.15.0 a new overload for Gdk::Cursor::create exists
which creates an ambiguity when passing a string literal.

We can avoid the ambiguity by explicitly constructing a Glib::ustring
from the string literal before calling the method.

https://gitlab.gnome.org/GNOME/gtkmm/-/issues/159
2024-08-21 13:33:36 +03:00
Yat Ho 1e16912ae4
refactor: new `tr_variant` API in `transmission-remote` and other cleanup (#6798)
* refactor: remove `Arguments`

* refactor: replace pointer args with lvalue reference

* refactor: use `uint16_t` for port number

* chore: housekeeping

* refactor: replace `char*` with `std::string_view`

* refactor: simplify argument parsing code

* refactor: use new `tr_variant` API in remote

* chore: rename function to snake_case

* chore: move `break` statements in switches outside of compound statements

* chore: use `std::string` literals

* refactor: extract tor start/stop to `MODE_TORRENT_START_STOP`

* refactor: extract tor actions to `MODE_TORRENT_ACTION`

* chore: iwyu

* fix: msvc build failure

* chore: misc cleanup

* fix: dereference optional

* chore: misc cleanup

* ui: fix minor formatting errors

* fix: remove redundant if branches for response string

* code review: remove `o` prefix for optionals

* code review: add condition clause

* code review: check `left_until_done` instead

* fix: unchecked nullptr

* code review: don't reassign method name

* code review: revert accidentally renaming `addIdArg` to `get_id_arg`

* code review: use `TR_ASSERT` instead of `assert`

* refactor: fix static auto constexpr naming

* code review: assert array size

* code review: assert that `arguments` key exists
2024-08-17 20:04:49 +01:00
Dmitry Rodiontsev fea9a8efb7
docs: fix a link to send-email-when-torrent-done.sh script in Transmission scripts (#7040) 2024-08-14 00:07:59 +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
Yat Ho 1ae39f8725
feat: log timestamps in local ISO8601 format (#7057)
* feat: log timestamps in local ISO8601 format

* code review: avoid repeated arguments

* code review: locale-independent decimal point character

* fix: pad sub-second part
2024-08-13 11:16:12 +01:00
Yat Ho 7e2212bfe0
refactor: simplify addrinfo unique_ptr definition (#7060) 2024-08-13 11:12:02 +01:00
Mike Gelfand dbea32809a
Refactor async torrent removal logic (#7059)
* Remove `tr_file_move_strict()`, add param to `tr_file_move()` instead

Also restores proper `local_error` logic to handle null error param.

* Remove unused `moved_files` logic

* Rename the callback type and params to match rename decls

* Add torrent ID param to torrent removal callback

* Remove mutex from torrent removal callback

Torrent IDs aren't reused during the lifetime of the session.

* Move main removal callback logic into a separate method
2024-08-13 06:19:36 +01:00
Lucas Clemente Vella 9fc9daf40d
Fails with an error if data removal was not possible (#6055)
* Do not remove torrent if trashing files failed.

Instead, stop the torrent and sets an error.

* Fixing GTK interface with new file removal behavior.

* C++17 compliant.

* Reverting unrelated change.

* Avoiding allocating unecessary objects.

* Easy review fixes.

* Fixing merge error.

* Adding result callback to tr_torrentRemove().

Using the new callback in Gtk GUI to decide when to remove it from the
interface.

* Reducing indentation level and making the function more readable.

* Using existing Session RefPtr.

* Notifying the client before freeing the torrent in the session.

* Addressing comments and synchronizing callback.

* Moving include.

* Fix constness issue reported by clang-tidy
2024-08-13 05:26:09 +01:00
Yat Ho abfd39065c
chore: bump small (#6976)
https://github.com/alandefreitas/small/pull/46
2024-08-13 03:00:58 +01:00
Cœur 2dcd01df1f
compatibility with libfmt v11 (#6979)
* compatibility with libfmt v11

* bumping fmt from 11.0.1 to 11.0.2
2024-08-13 02:41:05 +01:00
Robin Seth Ekman 0279f37377
fix: silence bugprone-unchecked-optional-access warnings (#6990)
* fix: silence bugprone-unchecked-optional-access warnings

clang-tidy emits bugprone-unchecked-optional-access warning for
`tr_sys_file_lock`. however, this is a false positive: the lines
warned about cannot be reached if the optional does not contain a value.
adding an `assert` silences these warnings.

* Apply suggestions from code review
2024-08-13 01:51:05 +01:00
Yat Ho 35ef8cf7a0
perf: avoid `std::advance` in cache.cc (#7025) 2024-08-13 01:03:02 +01:00
Cœur fe385259cc
Opt-in to secure coding explicitly (#7020) 2024-08-13 01:00:02 +01:00
Cœur e028ee4b1d
bump googletest from 1.14.0 to 1.15.2 (#7031) 2024-08-13 00:58:45 +01:00
Cœur 018fbbf074
bump fast_float from 6.1.1 to 6.1.3 (#7032) 2024-08-13 00:55:51 +01:00