Commit Graph

16173 Commits

Author SHA1 Message Date
Yat Ho 2315903015
build: accept false constant other than `OFF` for `REBUILD_WEB` (#7219) 2024-11-03 16:50:04 -06:00
Cœur c97527b555
Crash fix: "Invalid parameter not satisfying: aString != nil" (#7226) 2024-11-03 16:48:19 -06:00
Dzmitry Neviadomski 73f9600326
fix: support dark mode colors with pieces bar on macOS (#6959)
Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
2024-11-02 20:04:42 -05:00
Yat Ho 7978120c41
fix: save resume when shutting down (#7216)
Regression from 24bb159bfe
Xref: https://trac.transmissionbt.com/ticket/2317
2024-11-02 16:08:00 -05:00
Yat Ho 361b5c6152
fix: support nodejs below v20.11 for `generate_buildonly.js` (#7214) 2024-10-31 22:15:05 -05:00
Yat Ho 2c82f3d83d
fix: add missing `settings.json` docs and app defaults (#7218)
* docs: `trash-can-enabled` gtk only

* fix: add `pidfile` to daemon app defaults

* perf: don't copy string literal to variant
2024-10-31 22:14:44 -05:00
Yat Ho 1f36458e10
build: fail if clang-tidy is not found when `-DRUN_CLANG_TIDY=ON` (#7210) 2024-10-30 13:29:38 -05:00
Yat Ho f0e7c3ed74
chore: convert `transmission-web` to ES module (#7209) 2024-10-30 10:48:38 -05:00
Rukario dce515f37c
feat: display percent in progress bar for web client (#5937)
* Update transmission-app.scss

* Update torrent-row.js

* Update transmission-app.scss

* Update transmission-app.scss

* Update transmission-app.scss

* Update transmission-app.scss

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

* Update file-row.js

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

* Update formatter.js

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

* Update inspector.js

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

* Update torrent-row.js

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

* Update torrent.js

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

* Update transmission-app.scss

* Update transmission-app.scss

---------

Co-authored-by: Yat Ho <lagoho7@gmail.com>
2024-10-30 09:19:01 -05:00
Charles Kerr f988da6aa1
refactor: remove unused TR_SYS_FILE_APPEND (#7206) 2024-10-29 17:07:13 -05:00
Charles Kerr c1047b8009
refactor: remove unused TR_SYS_FILE_LOCK_UN (#7207) 2024-10-29 00:14:53 -05:00
Yat Ho c36a62e171
ci: automatically regenerate `package.json.buildonly` (#7198) 2024-10-28 15:45:29 -05:00
Yat Ho d5d950e1cf
fix: always sort peer candidates by score (#7199) 2024-10-27 19:54:09 -05:00
Yat Ho 13987e7996
refactor: warn peer incompliant behaviour in ltep (#7203)
* refactor: add log warning for ut metadata in private torrent

* refactor: add log warning for ut pex in private torrent

* refactor: add log warning for ltep handshake without advertised support

* refactor: unify ltep handshake log format

* refactor: removed redundant ltep logs

* refactor: add back log for ut pex
2024-10-27 19:38:56 -05:00
Yat Ho 5cc0934ddb
fix: clear tracker error if tracker is removed (#7141) 2024-10-24 21:45:43 -05:00
Yat Ho 3ec271fe5a
fix: count webseeds when calculating piece replication (#7028) 2024-10-23 20:49:01 -05:00
Charles Kerr d8adecbfb5
fix: clang-tidy-20 warnings in transmission-qt (#7192)
* fix: modernize-min-max-use-initializer-list warning

* fix: readability-container-contains warning

* fix: readability-avoid-return-with-void-value warning

* fix: readability-math-missing-parentheses warnings

* chore: clang-format

* fixup! fix: readability-math-missing-parentheses warnings

* fix: bugprone-suspicious-stringview-data-usage warning
2024-10-23 20:48:01 -05:00
Cœur 9513cdaebb
feat: clear the badge when quitting app (#7088) 2024-10-22 09:34:55 -05:00
Cœur 4e25c038a6
mac os autosize dock fix (#7188)
* macOS autosize dock fix

* Fix: Move variable declaration inside block to minimize scope length

* Fix: Move comment to its own line for better readability

* Fix: Use dot syntax for accessing scrollViewHeight property in calculateScrollViewHeightWithDockAdjustment method

* Fix: Add CGFloat type declaration for height variable

* rollback alignment change for clang-format

---------

Co-authored-by: emeritaacuity0u <emerita.acuity_0u@icloud.com>
2024-10-22 09:33:28 -05:00
Charles Kerr 19543ba65f
fix: clang-tidy-20 warnings (#7187)
* fix: readability-math-missing-parentheses clang-tidy warnings

* chore: remove unused function tr_ctorGetSession()

* chore: remove unused function tr_ctorGetIncompleteDir()

* chore: make generatePublicKey() a lambda

* fix: readability-container-contains warnings

* fix: misc-use-internal-linkage warnings

* chore: inline generate_public_key() since it was only used once
2024-10-21 20:57:01 -05:00
Julia 97abf15050
correct "Queue for download" last activity (#6872)
* simple fix

* apply suggestion
2024-10-21 20:56:37 -05:00
Bheesham Persaud 614244bfae
fix(web): pressing the enter key now submits dialogs (#7036)
Dialogs by themselves aren't submitted when pressing the Enter key,
for that we need to add an event handler to the dialog itself.

One approach I tried was to add a form to the dialog. This worked, but
needed a CSS workaround to keep the buttons in the same order.

Tested with some other dialogs as well:

* edit labels; and
* set location.

References:

* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog#handling_the_return_value_from_the_dialog
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formmethod
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#method

Fixes #6553
2024-10-21 19:13:42 -05:00
Yat Ho 89a88c6603
fix: `date done` and `recently-active` not updated on state change (#6992)
* fix: update `date_done_` as long as the torrent is done

* fix: `mark_change()` should be called as long as torrent state changes

* chore: remove redundant completeness update in `tr_torrent::start_in_session_thread()`

* fix: log whenever torrent state changes

* chore: add comment to explain `recent_change`

* chore: housekeeping

* fix: recover torrents with missing date done
2024-10-21 19:07:49 -05:00
Yat Ho ab66f73c74
fix: properly reconnect on handshake error (#6950)
* fix: clear read buffer when closing connection

* fix: clear write buffer when closing connection

* fix: disable encryption when reconnecting

* refactor: dedupe code

* fix: maybe reconnect using MSE handshake if it was an utp failure

* chore: misc housekeeping

* chore: removed `tr_peerIo::utp_supported_`

* refactor: more logs in `tr_handshake::on_error()`
2024-10-21 17:45:58 -05:00
Yat Ho b5cc6916ef
fix: don't retry plain handshake in `AwaitingVc` state (#6969) 2024-10-21 16:31:11 -05:00
Yat Ho 819d7f4136
fix: check `tr_num_parse` result in daemon (#7181) 2024-10-20 23:52:52 -05:00
Cœur a8bf44eeb1
fix: code should be clang-formatted (#7184) 2024-10-20 20:37:06 -05:00
Cœur 64cf3a236a
ci: fix macos-12-x86_64-from-tarball from GitHub workflows (#7169) 2024-10-20 11:44:43 -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 4f33520cba6a38171ed203a071158aa37ddcd325.

* 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