1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-14 07:59:15 +00:00
Commit graph

6221 commits

Author SHA1 Message Date
Charles Kerr
491cdc1560
refactor: remove TR_ARG_TUPLE macro (#7468) 2025-03-04 19:06:12 -06:00
Yat Ho
8c18cf4245
fix: use message id to check for pex and metadata xfer support (#7177)
* refactor: use metadata id to check for ut metadata support

* refactor: use pex id to check for ut pex support

* refactor: start pex timer after ltep handshake

* refactor: harden metadata xfer sanity checks

* code review: constexpr

* code review: don't save peer ut_pex_id and ut_metadata_id if on private torrent
2025-03-04 18:42:26 -06:00
Charles Kerr
0518a2269e
fix: do not mark Variant::make_map() as noexcept (#7466) 2025-03-04 18:42:08 -06:00
Charles Kerr
cbd65ae8b1
refactor: fix modernize-use-nodiscard warnings by adding [[nodiscard]] (#7351) 2025-03-04 17:28:33 -06:00
Yat Ho
52a12200b2
chore: bump wide-integer (#7383)
* chore: bump wide_integer

* refactor: use `uint64_t` for better performance
2025-03-04 08:19:01 -06:00
Yat Ho
48ba0fd2d8
refactor: remove builtin and asm popcount implementation (#7443) 2025-03-04 08:16:39 -06:00
Charles Kerr
05797a9e93
perf: cache curl version (#7461)
it doesn't change during runtime, so no need to
keep calling curl_version_info(CURLVERSION_NOW)
2025-03-04 08:16:21 -06:00
Yat Ho
76ab7ba592
refactor: set peer io socket in constructor (#7355)
* refactor: `tr_netOpenPeerSocket()` returns `tr_socket_t`

* refactor: store preferred transport as array

* refactor: set peer io socket in constructor

* refactor: remove `log_peer_io_bandwidth()`

This partially reverts commit efec6505

* refactor: rename `tr_netOpenPeerSocket` to snake_case

* code review: remove redundant comment

* code review: add comment about array order
2025-03-03 23:47:37 -06:00
pathC
5163ac3e1f
fix: not correctly sending UA to trackers related to curl gh6312 (#7447)
fallback to http1.1 when using flawed curl.
curl 7.71.0-7.74.0 are affected.
2025-03-03 23:14:20 -06:00
Yat Ho
43e869b18e
feat: warn about problematic curl versions (#7457) 2025-03-03 21:32:25 -06:00
Yat Ho
790bd2f0ab
fix: crashes related to curl gh10936 (#7416) 2025-01-27 22:36:47 +00:00
reardonia
50eacf6933
Consume early pad a/b, improve handshake tests (#6987)
* properly consume PadA in MSE handshake, check for invalid Ya+PadA

* refactor: make handshake constants public (needed for test coverage)

* test: split test MSE handshakes by blocking steps

* test: use `ASSERT_TRUE` instead of `assert`

* test: fix windows crash by using `recv` and `send`

Co-authored-by: Yat Ho <46261767+tearfur@users.noreply.github.com>

* refactor: use `TR_IF_WIN32` for `LOCAL_SOCKETPAIR_AF`

Co-authored-by: Yat Ho <46261767+tearfur@users.noreply.github.com>

---------

Co-authored-by: Yat Ho <lagoho7@gmail.com>
Co-authored-by: reardonia <reardonia@github.com>
Co-authored-by: Yat Ho <46261767+tearfur@users.noreply.github.com>
2025-01-09 10:26:48 -06:00
Charles Kerr
236cd6bae7
fix: cert-oop54-cpp warnings about self-assignment in strbuf (#7345) 2024-12-30 09:32:34 -06:00
Yat Ho
131caa1239
refactor: convert tr_net_init_mgr to singleton (#6914) 2024-12-30 09:32:11 -06:00
Yat Ho
a4cc98b92c
fix: speed limits did not work below 16KiB/s (#7339)
* refactor: calculate raw speed by OS buffer instead of application buffer

* refactor: limit transfer speed by raw speed

* refactor: early return write if no bytes

* refactor: remove code for guessing TCP/IP overhead

* refactor: remove code for uTP overhead
2024-12-29 01:42:07 -06:00
Charles Kerr
7820f54ba1
refactor: remove TR_DISABLE_COPY_MOVE macro (#7344) 2024-12-29 00:15:39 -06:00
Josh Grosse
b969b0bae1
fix: use process umask for new files. (#7195) 2024-12-27 18:20: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
Yat Ho
fb36f5d55d
fix: shadowed variable warning in tr_torrentVerify() (#7305) 2024-12-24 09:26:24 -06:00
Bark
1a38830ada
fix: Take into account only the private that is inside info. (#7313) 2024-12-23 14:08:05 -06:00
Yat Ho
5a05b37838
feat: support the JSON null type in tr_variant (#7255) 2024-12-15 16:50:19 -06:00
reardonia
5c714a5599
refactor: add handshake fire_timer() instead of overloading fire_done() (#6966) 2024-12-14 15:14:44 -06:00
Yat Ho
b3912fa1a5
feat: download first and last piece first in sequential mode (#6893)
* feat: download first and last piece first in sequential mode

* test: fix tests
2024-12-13 19:32:03 -06:00
Yat Ho
b4bbc8744e
refactor: use evhttp public accessors in rpc server (#7112)
* refactor: use libevent public accessors in `handle_request()`

* chore: housekeeping in `handle_request()`

* refactor: use libevent public accessors in `make_response()`

* refactor: use libevent public accessors in `serve_file()`

* refactor: use libevent public accessors in `handle_web_client()`

* refactor: use libevent public accessors in `handle_rpc_from_json()`

* refactor: use libevent public accessors in `handle_rpc()`

* refactor: use libevent public accessors in `isHostnameAllowed()`

* refactor: use libevent public accessors in `test_session_id()`
2024-12-13 14:15:30 -06:00
Yat Ho
31a63f0045
feat: log when RPC server reject requests (#7114) 2024-12-12 16:12:02 -06:00
Yat Ho
dd58e42105
fix: send ltep handshake if received ltep handshake (#7204)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-12-12 15:19:03 -06:00
Yat Ho
b2ce9eea83
fix: obtain session lock before getting tor ptr (#7286) 2024-12-12 15:17:07 -06:00
Yat Ho
90859fe115
test: use new tr_variant API (#7268)
* test: new `tr_variant` API in `json-test.cc`

* test: new `tr_variant` API in `variant-test.cc`

* chore: housekeeping

* test: new `tr_variant` API in `dht-test.cc`

* fix: use `reinterpret_cast` in `tr_variant::make_raw()`

* fix: add missing `typename` in `tr_variant::make_raw()`

* test: new `tr_variant` API in `settings-test.cc`

* test: new `tr_variant` API in `move-test.cc`

* test: new `tr_variant` API in `rpc-test.cc`

* test: new `tr_variant` API in `makemeta-test.cc`

* test: new `tr_variant` API in `session-test.cc`
2024-12-09 19:22:54 -06:00
Yat Ho
60e5d98dc1
fix: handle nullptr in json serde (#7258)
* fix: handle nullptr in json serde

* test: fuzz json serde
2024-12-09 11:59:10 -06:00
Yat Ho
affb03a8d2
refactor: remove tr_torrent::do_magnet_idle_work() (#7271)
* Revert "fix: possible heap-use-after-free with magnet links (#6815)"

This reverts commit 09b67c84b1.

* fix: check if torrent still exists before verifying

* refactor: queue `on_have_all_metainfo()` in session thread instead
2024-12-09 10:58:39 -06:00
Yat Ho
002c891216
refactor: use string_view literals instead of C string literals (#7266) 2024-11-26 19:52:05 -06: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
7e4b4f10a1
refactor: faster wishlist (#7027)
* chore: housekeeping

* perf: short circuit peer has block check

* refactor: track active requests in each respective peer

* refactor: swap `ActiveRequests` with new request tracking method

* refactor: use bitfield to store active requests per peer

* perf: check active request numbers first

* refactor: initialise candidate values in constructor

* refactor: better naming

* refactor: use `find_by_block()` more

* refactor: store wishlist mediator in swarm object

* test: make it compile

* test: update endgame test

* test: new test for choke event

* test: remove redundant lines

* test: new test for request event

* test: new test for reject event

* refactor: cache block have state in wishlist

* test: fix `gotBlockResortsPiece`

* fixup! refactor: track active requests in each respective peer

* fixup! test: fix `gotBlockResortsPiece`

* fix: count webseeds when calculating active requests

* build: update xcode project

* fix: add missing `candidates_dirty_` checks

* chore: remove old `depends-on` comments

* fixup! refactor: use bitfield to store active requests per peer

* refactor: extract block peer event to separate function

* perf: reorder conditions by overhead

* perf: check for completed block instead of completed piece

* chore: remove duplicated "unrequested piece" check

* refactor: merge similar block size sanity check

* refactor: use map to store number of requests in wishlist

* refactor: add asserts

* refactor: flush write buffer as soon as there is new data

* refactor: more accurate function naming

* fix: account for corrupt pieces in wishlist

* fix: account for unaligned blocks in wishlist

* Revert "fix: account for unaligned blocks in wishlist"

This reverts commit c3fce93cbae49c11d62e26caccedf55c1987aa95.

* fixup! refactor: use map to store number of requests in wishlist

* fix: account for unaligned blocks in wishlist v2

* chore: add `[[nodiscard]]`

* fixup! fix: account for unaligned blocks in wishlist v2

* fix: crash when handshake finishes in the middle of function
2024-11-11 19:30:00 -06:00
Yat Ho
5a881191d0
fix: allow unreachable peers to be retried (#6975)
`tr_peer_info::reconnect_interval_has_passed()` contains logic to increase the reconnect interval for unreachable peers, but it has no effect at all currently because they wouldn't be tried in the first place.
2024-11-08 12:44:27 -06:00
Yat Ho
49f4c604da
fix: don't increment failure count when stopping torrent (#7238)
* fix: don't increment failure count when stopping torrent

* refactor: don't reset failure count on torrent stop
2024-11-08 12:42:59 -06:00
Yat Ho
6bf62959b4
refactor: set CURLOPT_MAXREDIRS once (#7233) 2024-11-06 14:36:34 -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
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
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
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
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
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
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