1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-13 15:39:01 +00:00
Commit graph

232 commits

Author SHA1 Message Date
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
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
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
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
Yat Ho
c223c70644
fix: potential nullptr deference in rpc (#6734) 2024-03-25 09:55:45 -05:00
Charles Kerr
eeea3c540f
fix: clang-tidy-19 warnings (#6597)
* fix: readability-redundant-casting warnings in libtransmission

* fix: readability-avoid-return-with-void-value warnings in libtransmission

* fix: readability-redundant-member-init warnings in libtransmission

* fix: readability-redundant-inline-specifier warnings in libtransmission

* fix: performance-avoid-endl warnings in libtransmission

* fix: bugprone-multi-level-implicit-pointer-conversion warnings in libtransmission

* fix: bugprone-switch-missing-default-case warnings in libtransmission

* fix: readability-redundant-string-cstr warnings in libtransmission

* fixup! fix: bugprone-multi-level-implicit-pointer-conversion warnings in libtransmission
2024-02-13 10:42:19 -06:00
Yat Ho
32ef92e7a7
feat: do separate IPv4 and IPv6 port checks in Qt and GTK Client (#6525)
* fix: specify `port-test` ip protocol in response when possible

* feat: IPv4 and IPv6 port test in Qt Client

* feat: shorten timeout of `port-test`

* feat: IPv4 and IPv6 port test in Gtk Client

* chore: housekeeping

* refactor: remove IP protocol error message

* code review: mikedld gtk

* feat: return tag in qt rpc response

* code review: mikedld qt

* feat: move port test button up alongside spin button

* fixup! code review: mikedld gtk

* fixup! code review: mikedld qt

* code review: port status initial text

* feat: decouple ipv4 and ipv6 status updates (GTK)

* feat: decouple ipv4 and ipv6 status updates (Qt)

* code review: unknown protocols are non-pending

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>

* code review: simplify status text when the statuses are the same

* Revert "feat: return tag in qt rpc response"

This reverts commit 2a022c2bb0ee7ddad81f8176839cf0d043422368.

* code review: add translation context for status text (GTK)

* code review: move `port_test_pending_` to `Impl` (GTK)

* fixup! code review: move `port_test_pending_` to `Impl` (GTK)

---------

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2024-01-21 16:50:26 -06:00
Yat Ho
08b2fa7e35
fix: restore files-wanted argument of torrent-set (#6534)
* chore: drop redundant if branch

* chore: housekeeping

* refactor: always keep error message as the second

* fix: restore `files-wanted` argument of `torrent-set`
2024-01-21 14:41:13 -06:00
Charles Kerr
239478925f
fix: performance-enum-size warnings (#6504) 2024-01-08 08:32:58 -06:00
Yat Ho
df1dc5812c
fix: restore the tag key in RPC response (#6492)
* fix: restore the `tag` key in RPC response

* chore: `tr_rpc_request_exec()` housekeeping

* feat: new tests for RPC tag
2024-01-06 10:40:23 -06:00
Charles Kerr
22cde5d4b9
refactor: use new tr_variant API in rpcimpl (#6456)
* refactor: tr_rpc_request_exec_json takes a std::function callback

* refactor: tr_rpc_request_exec_json callback takes a tr_variant&&

* refactor: use new tr_variant API in rpcimpl.cc

* refactor: tr_rpc_request_exec_json() now takes a const& to the request

* fixup! refactor: use new tr_variant API in rpcimpl.cc

* chore: rename function to tr_rpc_request_exec()

* chore: remove unused DetailsDialog::Impl::build_torrent_ids_variant_list()

* refactor: minor copyediting in rpcimpl.cc getTorrents()

* refactor: split handler methods between sync, async

* refactor: remove unused args_out param from AsyncHandlers

* chore: fix new readability-inconsistent-declaration-parameter-name warning
2024-01-02 22:14:43 -06:00
qu1ck
427d813108
fix: support sequentialDownload in list of RPC torrent-get response keys (#6450) 2023-12-29 09:05:37 -06:00
Charles Kerr
2dea0b5fa2
fix: gcc 13 warnings, pt. 1 (#6400)
* fix: nullptr dereference warnings

* fix: mixed enumerated and non-enumerated warning

* fix: -Wnull-dereference warning in qt/MainWindow.cc

* fix: -Wnull-dereference warning in TorrentFilter::countTorrentsPerMode()

* fix: -Wnull-dereference warning in VariantHelpers::change(TrackerStat&, tr_variant*)

* build: bump google-test from 1.12.1 to 1.14.0

* Revert "build: bump google-test from 1.12.1 to 1.14.0"

This reverts commit 6fdcffa5de.
2023-12-17 12:49:39 -06:00
Charles Kerr
d766050dd8
perf: fewer temporary strings (#6325)
* perf: parse the .resume file contents inplace

* perf: use unmanaged strings in make_torrent_field()

* perf: accept moved strings in tr_error::set()

* perf: use small::vector in tr_peerMsgsImpl::sendPex()

the expected pex size is predictable and fits easily on the stack
2023-12-01 16:48:16 -06:00
Charles Kerr
25d67dd00d
refactor: in tr_announce_list, replace port_and_str with aggregated parsed url (#6323) 2023-12-01 15:48:04 -06:00
Charles Kerr
b00b8dd2fb
refactor: make tr_torrent::on_announce_list_changed() private (#6304) 2023-11-27 16:42:31 -06:00
Charles Kerr
777bdfecf1
refactor: make tr_torrent::queue_position_ private (#6301) 2023-11-27 01:27:57 -06:00
Charles Kerr
e14806c409
refactor: c++ify libtransmission's tr_ctor struct (#6295) 2023-11-26 15:43:37 -06:00
Charles Kerr
a12ef941e7
refactor: make tr_torrent fields, methods private where possible (#6293) 2023-11-25 20:00:20 -06:00
Yat Ho
7af71d9695
refactor: pause torrent after verifying if files disappeared (#6277) 2023-11-25 16:20:17 -06:00
Yat Ho
adc209d7e8
refactor: RPC port-test improvements (#6274) 2023-11-22 23:02:21 -06:00
Charles Kerr
64d9d57363
chore: fix minor clang-tidy warnings (#6275) 2023-11-21 09:02:03 -06:00
Charles Kerr
ad63c7d77f
refactor: make some tr_torrent fields private (#6259)
* refactor: make tr_torrent::is_stopping_ private

* refactor: make tr_torrent::is_queued_ private

* refactor: make tr_torrent::is_dirty_ private

* refactor: make tr_torrent::is_deleting_ private

* refactor: make tr_torrent::obfuscated_hash_ private

* refactor: demeter
2023-11-15 16:24:33 -06:00
Charles Kerr
07d96036d9
refactor: Values pt. 6 - remove deprecated API (#6250) 2023-11-14 17:23:51 -06:00
Charles Kerr
8ebb5b0bc3
refactor: Values pt. 4 - use Speed in peer_mgr, peer_msgs (#6241) 2023-11-12 14:38:27 -06:00
Charles Kerr
0e85befc0f
refactor: Values pt. 3 - use Speed in tr_session (#6235) 2023-11-12 12:30:37 -06:00
Charles Kerr
a575be778f
refactor: Values pt. 2 - use Speed in tr_bandwidth (#6234) 2023-11-10 17:12:24 -06:00
Charles Kerr
a952a0731f
refactor: remove the tr_error** idiom (#6198)
* refactor: remove the tr_error** idiom

* fix: tr_error::message() is only constexpr in c++20 and up

* chore: silence a couple of g++-12 Wshadow warnings
2023-11-04 11:39:41 -05:00
Julien
8ac323d5d6
chore: removed copyright timespans in headers (#4850) 2023-11-01 16:11:11 -05:00
Charles Kerr
e54b17d92e
refactor: blocklists (#6189) 2023-10-31 19:20:01 -04:00
Charles Kerr
f0e9f90782
refactor: move tr_session::getAllTorrents to tr_torrents (#6179) 2023-10-30 16:38:02 -04:00
Dzmitry Neviadomski
c697d95ad3
fix: crash after nullptr dereference in rpcimpl (#6177) 2023-10-30 13:30:10 -04:00
Charles Kerr
901de536a3
fix: in RPC, default to sort torrents by id (#5604)
When getting all torrents in a batch over RPC, the results are sorted by
info-dict hash. Prior to 4.0.0, they were sorted by ID. This change broke
some peoples' workflows.

I'm OK with breaking workflows if it's necessary to improve the program,
but this was an unintentional side-effect and I don't see any inherent
benefit to either sort order. So this PR restores the 3.00 sort order.

https://xkcd.com/1172/
2023-10-25 13:42:14 -04:00
Charles Kerr
bbc3ce039f
refactor: remove quark support from tr_variant (#6159) 2023-10-24 14:49:23 -04:00
Yat Ho
6d958bd5fc
feat: do separate IPv4 and IPv6 port checks in WebUI (#5953)
* feat: add `ipProtocol` argument to `port-test` rpc method

* chore: update rpc-spec.md

* feat: split port check UI to IPv4 and IPv6 in webUI

* fix: default `open` to false if cannot get response

* chore: minor docs wording tweak

* chore: make clang-tidy happy

* chore: RPC doc tweaks

* fix: bad merge

* chore: review feedback

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: match quark enum with parameter case

* refactor: use descriptive strings for `ipProtocol`

* chore: update docs

* fixup! refactor: use descriptive strings for `ipProtocol`

* fixup! chore: update docs

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-10-24 09:27:28 -04:00
Charles Kerr
735639c5c7
refactor: make tr_torrent::labels_ private (#6153) 2023-10-23 18:11:28 -04:00
Charles Kerr
682e4f2c2b
refactor: make tr_torrent::any_date_ private (#6148) 2023-10-21 23:23:08 -04:00
Charles Kerr
8f7330523c
chore: remove unused progress arg from tr_torrentSetLocation() (#6147) 2023-10-21 22:33:41 -04:00
Charles Kerr
4bdb3066d8
refactor: decouple tr_verify_worker from tr_torrent (#6123) 2023-10-19 08:39:34 -05:00
Yat Ho
0c52b710ad
feat: add option to force verify torrent in WebUI (#5981) 2023-10-06 22:52:59 -05:00
Yat Ho
2c97567370
chore: minor housekeeping for bandwidth code (#6080) 2023-10-06 18:30:04 -05:00
Charles Kerr
68f3c89e3c
refactor: make tr_torrent idle fields private (#6070) 2023-10-03 20:18:55 -05:00
Charles Kerr
32a62d85ea
refactor: more tr_variant API (#6057) 2023-10-02 16:18:35 -05:00
Charles Kerr
114885d67b
fixup! refactor: tr_variant API update (#5998) (#6036)
fix use of invalidated pointer in rpcipml
2023-09-25 13:24:46 -05:00
Charles Kerr
6ead147620
refactor: use new tr_variant API in tr_session (#6006) 2023-09-16 08:23:35 -05:00
Charles Kerr
5837603b6f
refactor: make tr_variant follow RAII (#5923) 2023-08-20 23:15:23 -05:00
tearfur
ca4cb1a675
fix/cleanups to tr_peerMsgsImpl (#5783)
* fix: correct condition to advertise pex support in ltep handshake

1. Advertise pex support regardless of whether the peer had advertised pex support. No reason to give up an opportunity to advertise pex support just because our direct peer does not support it.
2. Check if pex is enabled in global settings as well.
2023-07-14 10:51:52 -05:00
tearfur
5ec4ca550e
chore: iwyu (#5746) 2023-07-08 10:24:03 -05:00
Charles Kerr
c364abcb6f
chore: misc-include-cleaner (partial) (#5738) 2023-07-06 10:00:07 -05:00