22 Commits

Author SHA1 Message Date
Yat Ho
08ec7fb7c7 build: lint header files with clang-tidy (#7527)
* build: clang-tidy headers when building libtransmission

* chore: revert `= default` workaround

It was introduced in 6909ec0bad to fix build issues with macOS 10.14. We
no longer support that version.

* fix: clang-tidy warnings for libtransmission

* build: clang-tidy headers when building tests

* fix: clang-tidy warnings for tests

* build: clang-tidy headers when building qt

* code review: don't manually edit mime-types.h

* code review: unify variable naming for static private members
2025-05-07 22:10:16 +01:00
Charles Kerr
cbd65ae8b1 refactor: fix modernize-use-nodiscard warnings by adding [[nodiscard]] (#7351) 2025-03-04 17:28:33 -06:00
Yat Ho
2ba8cccfa7 fix: check full path when parsing http tracker responses (#7326)
* refactor: move path checking methods to base

* refactor: differentiate "empty string key" and "no key"

* fix: check full path when parsing http announce response

* fix: check full path when parsing http scrape response

* refactor: avoid copying when checking scrape info hash

* fixup! fix: check full path when parsing http scrape response
2024-12-24 14:30:50 -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
Yat Ho
a2b547fb50 chore: iwyu (#6201) 2023-11-03 12:03:26 -05:00
Julien
8ac323d5d6 chore: removed copyright timespans in headers (#4850) 2023-11-01 16:11:11 -05:00
Charles Kerr
a4d205612a refactor: add tr_variant_serde (#5903) 2023-08-17 11:02:45 -05:00
Charles Kerr
273f943a3b refactor: make a few more methods constexpr (#5798) 2023-07-15 19:02:39 -05:00
Julien
4b8cfa2e57 chore: update copyrights to 2023 (#4834) 2023-02-11 14:49:42 -06:00
Charles Kerr
ea05474464 perf: make methods constexpr (#3742) 2022-08-30 23:17:23 -05:00
Charles Kerr
83ffa6bf1b chore: fix spdx abbreviations (#3602) 2022-08-08 13:05:39 -05:00
Charles Kerr
fe288b45e5 perf: do not use tr_variant when parsing .torrent files 2022-05-23 23:05:16 -05:00
Charles Kerr
5e769fbc55 refactor: make tr_recentHistory a template class (#3012)
This gives more flexibility on the size of the count bins, so we can save space on smaller counts
2022-04-28 10:52:26 -05:00
Charles Kerr
f79a75cb21 test: fuzz test tr_variantFromBuf() (#2892)
* test: fuzz test tr_torrent_metainfo.parseBenc()

* fix: better error-checking in benc string parsing

* fix: return benc failure if the parse stack is unbalanced

* fix: stack range error when logging json parse errors

* test: fuzz test tr_variantFromBuf()
2022-04-06 16:39:39 -05:00
Charles Kerr
ca5799a4a8 refactor: annotate nodiscard, constexpr, noexcept methods (#2862) 2022-04-01 19:48:09 -05:00
Charles Kerr
d2f8e1d4e0 refactor: set logging levels (#2755) 2022-03-11 15:09:22 -06:00
Charles Kerr
5db993d348 chore: iwyu (#2553) 2022-01-31 17:05:35 -06:00
Charles Kerr
6f9cba4088 fixup! refactor: SAX-like benc parser pt. 1 (#2490) (#2544) 2022-01-30 21:12:57 -06:00
Charles Kerr
9e264250d1 refactor: add benc::Handler::Context (#2531)
Prerequisite for using the new benc parser in tr_torrent_metainfo:
That code needs to know the span of the bencoded info dict.
2022-01-28 16:46:14 -06:00
Charles Kerr
7f60738cce refactor: use the new benc parser in announcer-http (#2529) 2022-01-28 12:39:45 -06:00
Charles Kerr
ac823f3cc4 fix: sonarcloud warnings in new code (#2500) 2022-01-24 19:05:24 -06:00
Charles Kerr
5efec26a3b refactor: SAX-like benc parser pt. 1 (#2490)
* refactor: add SAX-like benc parser

This is the first part of a series of PRs whose end goal is to avoid
the overhead of tr_variant when parsing bencoded data, e.g. when
parsing .torrent files on startup or when parsing announce/scrape
tracker responses.

This PR introduces a SAX-like benc parser, reimplements variant-benc
to use the SAX benc parser (so that we don't have two benc parsers),
and updates the benc + variant tests.
2022-01-24 00:30:00 -06:00