Commit Graph

100 Commits

Author SHA1 Message Date
Charles Kerr
ceb12b8c61 refactor: avoid evbuffer use in tr_web, tr_webseed (#7743)
* refactor: add Task::add_data()

* refactor: move response body preallocation to Task ctor

* refactor: make Task::body() private

* refactor: add FetchOptions::on_data_received callback

* refactor: remove FetchOptions::buffer

* refactor: remove evbuffer from web.cc

* refactor: remove evbuffer from webseed.cc

* refactor: remove unused evbuffer_unique_ptr

* fix: copypaste error

Xref: https://github.com/transmission/transmission/pull/7743\#discussion_r2516592222
2025-11-12 16:27:39 -06:00
Charles Kerr
af92dc5d80 perf: use http range request info to preallocate response body buffer (#7800) 2025-11-11 09:32:00 -06:00
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
Yat Ho
03c2dbd63c feat: make proxy_url nullable (#7486)
* fix: clang-tidy warning

* refactor: make `proxy_url` nullable
2025-05-01 16:57:46 +01:00
Alexander Terentyev
2c5b7f94d1 feat: proxy support for web-connections (#5038)
* feature: proxy support for web-connections

* forgotten changes

* fix code-styles

* –Documentation for new setting "proxy-url"

* Create property proxyUrl for class tr_web. Lazy creation of tr_web object in tr_session after loaded settings from file

* Update docs/Editing-Configuration-Files.md

Simplify the documentation text

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>

* Fix merge error

* Fix merge error.

* Simplify tr_web's lifecycle. Fix error. Rename quark to sneak_case-style

* Fix parameter value test

---------

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-10 17:32:18 -05:00
Charles Kerr
d1a1a0adae fix: clang-tidy header warnings, pt. 1 (#7228)
* fix: warning: deleted member function should be public [modernize-use-equals-delete]

* fix: warning: variable has inline specifier but is implicitly inlined [readability-redundant-inline-specifier]

* fix: warning: enum uses a larger base type than necessary for its value set [performance-enum-size]

* fix: warning: initializer for member is redundant [readability-redundant-member-init]

* warning: parameter is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
2024-11-17 20:04:55 -06:00
Yat Ho
f1102f0b4d fix: don't double count webseed download data rate (#7235)
Regression from f1a53840f9
2024-11-06 13:55:58 -06:00
Yat Ho
adc209d7e8 refactor: RPC port-test improvements (#6274) 2023-11-22 23:02:21 -06:00
Yat Ho
90e91d6284 refactor: directly check if announcers are idle instead of using a stop counter (#6237) 2023-11-12 21:43:43 -06:00
Julien
8ac323d5d6 chore: removed copyright timespans in headers (#4850) 2023-11-01 16:11:11 -05:00
tearfur
a88b353576 chore: rename other publicAddress() functions (#5873) 2023-08-14 10:31:12 -05:00
tearfur
5ec4ca550e chore: iwyu (#5746) 2023-07-08 10:24:03 -05:00
Charles Kerr
ce66e5c442 iwyu: remove, add std headers where used (#5694)
* chore: remove unused #include <array>

* chore: remove unused #include <chrono>

* chore: remove unused #include <set>

* chore: remove unused #include <algorithm>

* chore: remove unused #include "interned-string.h"

* chore: remove unused #include <list>

* chore: remove unused #include <optional>

* chore: iwyu <cstddef>

* chore: iwyu <ctime>

* chore: remove unused #include <cerrno>

* chore: remove unused #include <deque>

* chore: remove unused #include <vector>

* chore: remove unused #include <memory>

* chore: remove unused #include <unordered_set>

* chore: remove unused #include <array>

* chore: remove unused #include <mutex>

* chore: remove unused #include <functional>

* chore: remove unused #include <cmath>
2023-06-29 23:51:55 -05:00
Charles Kerr
dc88b97f37 refactor: small again (#5666)
* refactor: restore the non-small parts of 5654

* refactor: restore the peer-mgr-active-requests parts of 5654

* chore: iwyu evbuffer in web.h
2023-06-25 12:33:32 -05:00
Charles Kerr
df1adf0e0f chore: revert small buffer (#5654)
* Revert "perf: use libsmall in libtransmission, pt 3 (#5653)"

This reverts commit 3b03494580.

* Revert "perf: use small in libtransmission (#5650)"

This reverts commit 559f6f0332.
2023-06-22 18:42:48 -05:00
Charles Kerr
559f6f0332 perf: use small in libtransmission (#5650)
* refactor: reimplement Buffer using small

* refactor: use SmallBuffer in announcer-udp

* refactor: use SmallBuffer in variant-json

* refactor: use SmallBuffer in variant-benc

* refactor: use SmallBuffer in handshake

* refactor: use SmallBuffer in peer-msgs

* refactor: delete move semantics on stack-based buffers
2023-06-21 22:41:09 -05:00
Charles Kerr
1b6b85989c feat: add generic favicon_cache class for reuse between Qt, GTK app (#5294) 2023-04-22 21:11:16 -05:00
Julien
4b8cfa2e57 chore: update copyrights to 2023 (#4834) 2023-02-11 14:49:42 -06:00
Charles Kerr
724a0f48f0 fix: clang-tidy header warnings (#4686) 2023-01-28 17:58:20 -06:00
Cœur
c89edcd1f6 underscores in documentation comments should be code escaped (#4639) 2023-01-23 10:26:11 -06:00
Charles Kerr
2d2a5e1ad6 refactor: more constexpr (#4518) 2023-01-02 11:34:36 -06:00
Charles Kerr
a1892f2c7c fix: 4.0.0-beta.2 regression transmission-show --scrape did not exit cleanly (#4447) 2022-12-23 08:03:26 -06:00
Charles Kerr
f03fc9270b Fix/long shutdown crash on shutdown (#4285) 2022-11-30 13:00:34 -06:00
Charles Kerr
22d12aedc5 refactor: GTK favicon lookup improvements (#4278) 2022-11-29 18:09:32 -06:00
A Cœur
d26db72d7e Fix "Implicit conversion loses integer precision" (#4194) 2022-11-21 10:19:45 -06:00
Charles Kerr
831eb8d40f refactor: make tr_session_thread a unique_ptr owned by tr_session (#4069) 2022-11-04 16:20:27 -05:00
Viacheslav Chimishuk
cb17ea4914 Fix IPv6 announce socket binding interface. (#3692)
When Transmission listens on both IPv4 and IPv6 interfaces IPv4 listen address
is always passed to CURL's CURLOPT_INTERFACE. In general it stays unnoticed but
if user has multiple IPv6 addresses configured on his system random (first?)
IPv6 address is used. It happens because passed value to CURLOPT_INTERFACE
is not correct -- IPv6 expected but IPv4 is passed.
2022-08-21 18:37:38 -05:00
Charles Kerr
29f57bc296 chore: iwyu headers (#3661) 2022-08-17 11:08:36 -05:00
Charles Kerr
83ffa6bf1b chore: fix spdx abbreviations (#3602) 2022-08-08 13:05:39 -05:00
Charles Kerr
85a7d0e09d refactor: rename Bandwidth as tr_bandwidth (#3379) 2022-06-29 15:08:58 -05:00
Lucas Clemente Vella
42198afc5f Implement latest version of BEP-7 for HTTP requests (#1661)
* Implement BEP-7 for HTTP announce (fixes #1659)
2022-06-17 20:33:11 -05:00
Charles Kerr
d1030b58b1 perf: use std::string_view for compile-time UserAgent (#3161) 2022-05-31 09:28:01 -05:00
Charles Kerr
aa2bb367ab chore: iwyu cleanup (#2981) 2022-04-24 20:49:52 -05:00
Antoine Cœur
bdac708762 docs: fix various typos and misspellings (#2955) 2022-04-21 09:28:38 -05:00
Charles Kerr
80dd460773 refactor: annotate nodiscard, constexpr, noexcept methods (#2879) 2022-04-04 22:51:56 -05:00
Charles Kerr
95e30768c4 refactor: rename mediator classes (#2681) 2022-02-22 09:09:24 -06:00
Charles Kerr
29af76d977 refactor: tr_web (#2640)
* fixup! refactor: tr_web (#2633)

fix: race condition in web threadfunc during bootstrap

fixes #2639
2022-02-17 17:35:57 -06:00
Charles Kerr
f1a53840f9 refactor: tr_web (#2633)
* refactor: fix tr_web rate limiting and dns caching
2022-02-16 12:33:50 -06:00
Charles Kerr
8805d7c67b refactor: remove tr_webGetTaskResponseCode() (#2628)
It's not really needed anymore, and removing it is aligned with the
goal of simplifying the tr_web and tr_webseed codebase.
2022-02-14 16:39:52 -06:00
Charles Kerr
a822a46e47 refactor: add fetch options object to tr_webRun() (#2620)
* refactor: add fetch options object to tr_webRun()

Fold `tr_webRun()`, `tr_webRunWithCookies()`, and `tr_webRunWebseed()`
into a single API that takes an options argument that callers can
customize to their needs.

Also does a surface cleanup pass to the tr_webseed and tr_web internal
structures, e.g. making fields const where possible, not using raw
pointers, and making some fields private.

This revision is still full of code smells. Refactoring the entire
system is overwhelming, so instead I'm doing it in incremental steps.
2022-02-13 20:09:56 -06:00
Charles Kerr
dfe79af34c refactor: tr_webseed simplification (#2613)
* refactor: remove effective-url caching in webseeds

The upcoming CURLSH refactor is a more effective way of doing this and
the current appoach makes tr_web harder to refactor, so remove it.

* refactor: webseed rate limiting

The current code that limits the number of parallel fetches is overly
complicated and is also interwoven into the tr_webseed class. Extract
it into a new private helper class "ConnectionLimiter" with a simpler
public API for tr_webseed to use.
2022-02-12 16:52:40 -06:00
Charles Kerr
df1cca9b57 chore: update copyright years, make notices consistent (#2463) 2022-01-20 12:27:56 -06:00
Charles Kerr
cef3f43088 refactor: tr_web's callback now uses std::string_view (#2172)
* refactor: tr_web tasks now use a std::string_view argument
2021-11-15 12:10:18 -06:00
Charles Kerr
8980a33f4a refactor: tr_webRun() now takes std::string_view args (#2162) 2021-11-14 19:17:03 -06:00
Charles Kerr
d8b57fe4dc refactor: web_utils (#2121)
* chore: move web utils from web, utils to web-utils
2021-11-08 21:30:03 -06:00
Charles Kerr
7724111a8b refactor: increase use of tr sha1 digest t (#2091)
* refactor: make tr_sha1_digest_t an array of std::byte

* refactor: increase use of tr_sha1_digest_t
2021-11-03 19:55:04 -05:00
Charles Kerr
43ad1346eb refactor: tr_torrentInfoGetMagnetLink now takes a std::string_view (#1968)
* refactor: tr_torrentInfoGetMagnetLink now takes a std::string_view
2021-10-16 08:20:04 -05:00
Charles Kerr
cc204e0b2c refactor: prefer "using" over "typedef" (#1883)
* refactor: prefer "using" over "typedef"
2021-10-06 09:26:07 -05:00
Charles Kerr
17ee032dd8 refactor: remove TR_BEGIN_DECLS, TR_END_DECLS (#1837)
* refactor: remove TR_BEGIN_DECLS, TR_END_DECLS
2021-09-25 11:07:22 -05:00
Mike Gelfand
db3d40d0ed Switch to clang-format for code formatting, include Mac client 2021-08-16 00:38:29 +03:00