Commit Graph

5912 Commits

Author SHA1 Message Date
Charles Kerr 43030132fc
refactor: use std::variant in tr_variant (#5936) 2023-08-23 12:57:58 -05:00
Charles Kerr fbfbfac3ae
fix: minor coverity warnings (#5916)
* fix: unchecked return value from tr_variantDictFindInt()

coverity 1541113

* fix: unchecked return value from tr_variantDictFindBool()

coverity 1541112

* fix: copy-instead-of-move in tr_strlower()

coverity 1541092

* fix: use auto& instead of auto in test

coverity 1541084

* fix: logically dead code

coverity 1541065

* fix: copy-instead-of-move in tr_announcer_impl::addTorrent()

coverity 1541062

* fix: unchecked return value of tr_variantDictFindInt()

coverity 1541061

* fix: copy-instead-of-move in FilterBar::Impl::tracker_filter_model_update()

coverity 1541058

* fix: copy-instead-of-move in gtr_window_on_close()

* fix: silence invalid resource leak warning

coverity 1520595

* fix: unchecked return value from setsockopt()

coverity 1518345

* fix: dereference after null check (FORWARD_NULL)

coverity 1517816
2023-08-21 21:59:47 -05:00
Charles Kerr 59c638c63d
refactor: replace tr_variant::is_*() with tr_variant::holds_alternative() (#5930) 2023-08-21 16:16:54 -05:00
Charles Kerr 5837603b6f
refactor: make tr_variant follow RAII (#5923) 2023-08-20 23:15:23 -05:00
Yat Ho bb386cf17f
refactor: use one socket for sending and receiving lpd announces (#5909) 2023-08-18 15:56:28 -05:00
Yat Ho eea7d4d886
refactor: re-organise `net.h` member functions (#5878) 2023-08-17 22:13:01 -05:00
Charles Kerr a4d205612a
refactor: add tr_variant_serde (#5903) 2023-08-17 11:02:45 -05:00
fredo-47 9df4adf9b6
chore: change some log-levels in global-ip-cache.cc from info to debug (#5870) 2023-08-15 13:47:20 -05:00
tearfur 449549c84f
fix: do not mark peer as not connectable when we are currently connected (#5889) 2023-08-14 16:46:09 -05:00
tearfur a88b353576
chore: rename other publicAddress() functions (#5873) 2023-08-14 10:31:12 -05:00
tearfur 0c7992baa2
fix: cover all pex disabled cases in `get_peer_candidate()` (#5806) 2023-08-14 09:56:43 -05:00
tearfur 72f604dbf8
fixup! perf: improve sorting performance in `tr_peerMgrGetPeers()` (#5807) 2023-08-13 22:02:11 -05:00
Zhenyu Qi 8873f2a50c
fix: announce with query replace bug (#5871) 2023-08-13 19:27:55 -05:00
tearfur 27f3a5b82a
fix: announce LDP on listening interface (#5875)
* fix: make sure LDP announces are sent on the listening interface

* fix: add implementation for test mediator

* fix: set SO_REUSEADDR for send socket
2023-08-13 12:04:04 -05:00
tearfur badeed374f
fix: incorrect pex flags merge logic (#5876) 2023-08-05 12:37:33 -05:00
tearfur a2849219f7
feat: split connectable and non-connectable pool (#5801) 2023-08-01 09:56:26 -05:00
Mike Gelfand c14094f4c9
Use clang-format for qualifier alignment (#5845)
`QualifierAlignment` option is available since clang-format v14 and
works better than our own script.
2023-07-30 16:43:43 +01:00
Cœur 84f9d01e7d
fix: -fobjc-arc with GCC (#5632) 2023-07-29 20:57:43 -05:00
tearfur 8b4d05d4e5
fixup! refactor: `tr_torrent.incompleteMetadata` from raw pointer to `std::optional` (#5837) 2023-07-29 08:49:52 -05:00
Charles Kerr c6e47c232e
refactor: use std::variant in tr_variant, pt 1: make tr_variant_string private (#5832) 2023-07-28 16:14:31 -05:00
tearfur d2fabc737b
fix: disregard locale when building LDP announce message (#5825) 2023-07-28 10:31:11 -05:00
Charles Kerr ed3f6c2ec8
fixup! perf: use small::max_size_vector in tr_torrentGetMetadataPiece (#5830)
* fixup! perf: use small::max_size_vector in tr_torrentGetMetadataPiece() (#5768)

* enable tests for alpine CI

---------

Co-authored-by: tearfur <46261767+tearfur@users.noreply.github.com>
2023-07-28 09:53:10 -05:00
tearfur 22da17f13f
fix: clamp down harder for upload as well (#5821) 2023-07-25 11:53:33 -05:00
tearfur f758cb3597
refactor: avoid code duplication (#5793) 2023-07-17 08:56:57 -05:00
Charles Kerr ea9fd64830
refactor: tr_compare_3way() (#5799) 2023-07-15 21:55:44 -05:00
Charles Kerr 273f943a3b
refactor: make a few more methods `constexpr` (#5798) 2023-07-15 19:02:39 -05:00
tearfur 31f2c7aa29
refactor: `tr_torrent.incompleteMetadata` from raw pointer to `std::optional` (#5791) 2023-07-15 15:38:38 -05:00
tearfur 01f25b030c
perf: improve sorting performance in `tr_peerMgrGetPeers()` (#5792) 2023-07-15 08:18:37 -05:00
Charles Kerr 32af004248
perf: reuse the vector in receonnectPulse(). (#5788) 2023-07-14 17:46:10 -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
Charles Kerr c867f00153
refactor: replace `peer_atom` with `tr_peer_info` (#5773) 2023-07-14 07:06:25 -05:00
tearfur 2ec19e694d
chore: minor code cleanup (#5760) 2023-07-13 09:10:43 -05:00
Charles Kerr a9a6e54858
refactor: make tr_socket_address a class (#5772) 2023-07-12 17:29:47 -05:00
Charles Kerr bc562eb9a5
perf: avoid atom lookup in tr_peerMgrSetUtpSupported() (#5766) 2023-07-12 10:10:20 -05:00
tearfur 0350b62248
refactor: remove redundant seed limit check (#5770) 2023-07-12 08:27:06 -05:00
Charles Kerr f036b7c3bf
perf: use small::max_size_vector in tr_torrentGetMetadataPiece() (#5768) 2023-07-12 07:36:16 -05:00
tearfur 8d0788dd9e
fix: incorret log message in `global-ip-cache.cc` (#5769) 2023-07-11 22:16:46 -05:00
tearfur 78367c098f
perf: use `std::unordered_map` for `tr_swarm.pool` and Handshakes (#5740) 2023-07-11 11:57:29 -05:00
Charles Kerr 8169d524ea
feat: do not auto-disconnect when a known seed initiates a connection and we are seeding (#5756) 2023-07-08 14:27:31 -05:00
tearfur 8e822a3cbb
perf: avoid copying/moving elements in peer candidate list (#5755) 2023-07-08 13:09:34 -05:00
tearfur 5ec4ca550e
chore: iwyu (#5746) 2023-07-08 10:24:03 -05:00
Charles Kerr 82f08420fd
fix: crash regression in tr_peerMgr::make_new_peer_connections() 2023-07-08 09:32:20 -05:00
Charles Kerr ec54e7f11e
fixup! refactor: remove libtransmission::Buffer (#5676) (#5748) 2023-07-08 02:25:57 -05:00
tearfur 97da2adbca
fix: spelling mistake in `net.h` function call (#5739) 2023-07-07 20:13:02 -05:00
Charles Kerr fdf042d32c
refactor: add tr_compare_3way() (#5742)
* refactor: add tr_compare_3way()

This is a small templated utility function to make libtransmission's
sorting / comparison code more consistent and easier to read.
2023-07-06 18:51:08 -05:00
Charles Kerr c364abcb6f
chore: misc-include-cleaner (partial) (#5738) 2023-07-06 10:00:07 -05:00
Charles Kerr 685e245f4a
perf: faster get peer candidates (#5734) 2023-07-05 23:16:18 -05:00
tearfur 2211086338
fix: conform to libcurl requirements to avoid memory leak (#5702) 2023-07-05 22:05:03 -05:00
Charles Kerr f83a60830a
refactor: add tr_socket_address typedef (#5730) 2023-07-05 11:33:50 -05:00
tearfur 6482d78852
perf: reduce copying in `enforceSwarmPeerLimit()` (#5731)
* reduce copying in `enforceSwarmPeerLimit()`

* clearer comparator naming
2023-07-05 10:10:04 -05:00