* 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
* 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>
* 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
* 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
* 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()`
* 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`
* 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
* 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]
* 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
`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.
* 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
* 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
* 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