transmission/libtransmission
Yat Ho 9ff95d162e
fix: various pex flag bugs and cleanup (#6917)
* fix: allow connection between seeds when pex is enabled

* chore: add comment to explain `tr_peerMsgs::on_torrent_got_metainfo()`

* refactor: remove `tr_swarm::mark_peer_as_seed()`

* fix: update seed flag in response to BT msgs

Regression from 81a42c6bb6

* chore: remove redundant code to update peer seed flag

* refactor: inc failure count if there were no piece data exchanged

* fix: save information from ltep handshake

* refactor: rename `tr_peerIo::is_seed_` to disambiguate

* fix: add instead of set pex flags when adding non-pex and non-resume peers

* fix: don't mark peer as connectable on getting ltep port msg

By BEP-11's definition, this flag is only set for peers whom we successfully initiated an outgoing connection with.

* refactor: set holepunch flag when we get it from ltep handshake

* fix: only accept positive `reqq` in ltep handshake

* refactor: handle encryption preference in `tr_peer_info`

* refactor: prefer own value for utp support

* refactor: make `tr_peer_info::from_first_` const

* refactor: handle holepunch support in `tr_peer_info`

* fix: parse metadata size only if we have a valid extention id for metadata xfer

* refactor: remove `tr_peer_info::add_pex_flags()` as it's no longer needed

* fix: correctly handle holepunch support when there is no `m` key in ltep handshake

* fix: distinguish between upload only and seed

Say we just connected to a partial seed, the peer sends an ltep handshake that has the `upload_only` key, then a BT `Bitfield` message:

Without this change, the pex seed flag would be set when parsing the ltep handshake, then immediately unset when parsing the `Bitfield` message.

We don't want that.

* fix: don't update `tr_peer_info::is_seed_` when merging peer info objects

* perf: priority in peer candidate score need 2 bits only

* fix: prefer to connect to downloading peers

Regression from c867f00153

* chore: add TODO for C++20 opportunity

* refactor: don't filter out peers without `ADDED_F_CONNECTABLE`

revert change from a2849219f7

* refactor: move peer state updates out of peermgr code

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-08 22:05:03 -05:00
..
.clang-tidy refactor: libtransmission Settings (#6592) 2024-02-15 11:31:09 -06:00
CMakeLists.txt chore: misc code cleanups (#6927) 2024-07-14 01:37:55 +01:00
announce-list.cc fix: misc-include-cleaner clang-tidy warnings (#6502) 2024-01-07 14:21:05 -06:00
announce-list.h
announcer-common.h feat: dual stack udp tracker support (#6687) 2024-05-26 15:43:55 -05:00
announcer-http.cc fix: don't process http announce error if already succeeded (#7086) 2024-09-02 16:24:35 -05:00
announcer-udp.cc refactor: simplify addrinfo unique_ptr definition (#7060) 2024-08-13 11:12:02 +01:00
announcer.cc fix: various pex flag bugs and cleanup (#6917) 2024-09-08 22:05:03 -05:00
announcer.h fix: various pex flag bugs and cleanup (#6917) 2024-09-08 22:05:03 -05:00
bandwidth.cc
bandwidth.h
benc.h
bitfield.cc
bitfield.h
block-info.cc
block-info.h refactor: remove last byte special case in `tr_block_info::byte_loc()` (#7064) 2024-08-22 19:03:14 -05:00
blocklist.cc fix: misc net.cc and blocklist.cc fixes (#6717) 2024-03-24 17:09:51 -05:00
blocklist.h
cache.cc perf: avoid `std::advance` in cache.cc (#7025) 2024-08-13 01:03:02 +01:00
cache.h fix: sonarcloud warnings (#6615) 2024-02-17 22:43:24 -06:00
clients.cc
clients.h
completion.cc refactor: remove torrent_view virtual class (#6738) 2024-03-30 14:45:00 -05:00
completion.h refactor: remove torrent_view virtual class (#6738) 2024-03-30 14:45:00 -05:00
crypto-utils-ccrypto.cc refactor: aggregate crypto handles when computing digests (#6662) 2024-03-04 16:59:51 -06:00
crypto-utils-fallback.cc
crypto-utils-mbedtls.cc chore: iwyu (#6864) 2024-05-27 17:36:02 -05:00
crypto-utils-openssl.cc chore: iwyu (#6864) 2024-05-27 17:36:02 -05:00
crypto-utils-wolfssl.cc chore: iwyu (#6864) 2024-05-27 17:36:02 -05:00
crypto-utils.cc
crypto-utils.h chore: iwyu (#6864) 2024-05-27 17:36:02 -05:00
error-types.h Add CI configuration for clang-tidy on Windows (#6997) 2024-07-16 22:13:29 +01:00
error.cc
error.h
favicon-cache.h fix compatibility with clang-format 18 (#6690) 2024-03-15 00:17:10 -05:00
file-capacity.cc Add CI configuration for clang-tidy on Windows (#6997) 2024-07-16 22:13:29 +01:00
file-piece-map.cc refactor: remove last byte special case in `tr_block_info::byte_loc()` (#7064) 2024-08-22 19:03:14 -05:00
file-piece-map.h
file-posix.cc fix: silence bugprone-unchecked-optional-access warnings (#6990) 2024-08-13 01:51:05 +01:00
file-win32.cc Add CI configuration for clang-tidy on Windows (#6997) 2024-07-16 22:13:29 +01:00
file.cc refactor: replace tr_sys_file_write_line() with fmt::print("...\n") (#6619) 2024-02-25 16:12:08 -06:00
file.h refactor: remove tr_sys_file_flush() (#6647) 2024-03-03 23:29:38 -06:00
handshake.cc fix: process BT messages that immediately follows handshake (#6913) 2024-08-24 17:04:28 -05:00
handshake.h fix: process BT messages that immediately follows handshake (#6913) 2024-08-24 17:04:28 -05:00
history.h Update outdated Doxygen params refs for tr_recentHistory (#6791) 2024-05-24 10:31:50 -05:00
inout.cc refactor: aggregate crypto handles when computing digests (#6662) 2024-03-04 16:59:51 -06:00
inout.h
interned-string.h
ip-cache.cc chore: misc code cleanups (#6927) 2024-07-14 01:37:55 +01:00
ip-cache.h chore: misc code cleanups (#6927) 2024-07-14 01:37:55 +01:00
libt.dox
log.cc fix: accurate timestamp in daemon logs (#7009) 2024-08-13 23:57:52 +01:00
log.h fix: accurate timestamp in daemon logs (#7009) 2024-08-13 23:57:52 +01:00
lru-cache.h fix: sonarcloud warnings (#6615) 2024-02-17 22:43:24 -06:00
magnet-metainfo.cc refactor: convert `tr_peerMsgsImpl` helper functions to class methods (#6580) 2024-03-15 19:52:09 -05:00
magnet-metainfo.h
makemeta.cc fix: restore portable file path check (#6853) 2024-05-25 10:08:53 -05:00
makemeta.h fix: restore portable file path check (#6853) 2024-05-25 10:08:53 -05:00
mime-types.h libtransmission: fix copyright header generation (#6874) 2024-06-01 15:39:33 +01:00
mime-types.js libtransmission: fix copyright header generation (#6874) 2024-06-01 15:39:33 +01:00
net.cc fix: don't call `tr_logAddTraceIo` before `tr_peerIo::set_socket()` (#6881) 2024-06-01 16:23:46 +01:00
net.h chore: iwyu (#6864) 2024-05-27 17:36:02 -05:00
observable.h
open-files.cc Add CI configuration for clang-tidy on Windows (#6997) 2024-07-16 22:13:29 +01:00
open-files.h
peer-common.h fix: limit number of bad pieces to accept from a webseed (#6875) 2024-08-24 14:18:12 -05:00
peer-io.cc fix: various pex flag bugs and cleanup (#6917) 2024-09-08 22:05:03 -05:00
peer-io.h fix: various pex flag bugs and cleanup (#6917) 2024-09-08 22:05:03 -05:00
peer-mgr-active-requests.cc Add CI configuration for clang-tidy on Windows (#6997) 2024-07-16 22:13:29 +01:00
peer-mgr-active-requests.h refactor: convert `tr_peerMsgsImpl` helper functions to class methods (#6580) 2024-03-15 19:52:09 -05:00
peer-mgr-wishlist.cc fix: sonarcloud warnings (#6615) 2024-02-17 22:43:24 -06:00
peer-mgr-wishlist.h perf: followup improvements to `3.00` Wishlist (#6589) 2024-02-11 21:13:59 -06:00
peer-mgr.cc fix: various pex flag bugs and cleanup (#6917) 2024-09-08 22:05:03 -05:00
peer-mgr.h fix: various pex flag bugs and cleanup (#6917) 2024-09-08 22:05:03 -05:00
peer-mse.cc perf: lazy initialise Diffie-Hellman in handshake (#6949) 2024-08-23 16:14:45 -05:00
peer-mse.h perf: lazy initialise Diffie-Hellman in handshake (#6949) 2024-08-23 16:14:45 -05:00
peer-msgs.cc fix: various pex flag bugs and cleanup (#6917) 2024-09-08 22:05:03 -05:00
peer-msgs.h fix: limit number of bad pieces to accept from a webseed (#6875) 2024-08-24 14:18:12 -05:00
peer-socket.cc
peer-socket.h
platform.cc Add CI configuration for clang-tidy on Windows (#6997) 2024-07-16 22:13:29 +01:00
platform.h
port-forwarding-natpmp.cc feat: allow port forwarding state to recover from error (#6718) 2024-05-25 17:08:16 -05:00
port-forwarding-natpmp.h
port-forwarding-upnp.cc bump miniupnpc to 2.2.8 (#6907) 2024-06-15 00:24:06 +01:00
port-forwarding-upnp.h feat: support different internal and external port for UPnP (#6672) 2024-03-31 18:49:19 -05:00
port-forwarding.cc feat: support different internal and external port for UPnP (#6672) 2024-03-31 18:49:19 -05:00
port-forwarding.h feat: support different internal and external port for UPnP (#6672) 2024-03-31 18:49:19 -05:00
quark.cc chore: iwyu (#6864) 2024-05-27 17:36:02 -05:00
quark.h Add start_paused to settings file and daemon (#6728) 2024-03-30 16:39:44 -05:00
resume.cc fix: loading `2.20-3.00` progress from resume (#6896) 2024-07-14 08:37:43 +01:00
resume.h fix: save sequential download across sessions (#6746) 2024-03-31 15:01:05 -05:00
rpc-server.cc Use std::declval instead of nullptr cast trick (#6785) 2024-04-15 15:18:43 -05:00
rpc-server.h fix: sonarcloud warnings (#6615) 2024-02-17 22:43:24 -06:00
rpcimpl.cc feat: configurable client `reqq` (#7030) 2024-08-23 21:46:37 -05:00
rpcimpl.h refactor: use new tr_variant API in rpcimpl (#6456) 2024-01-02 22:14:43 -06:00
session-alt-speeds.cc fix: apply alt speed settings on load (#6937) 2024-07-11 00:55:34 +01:00
session-alt-speeds.h fix: apply alt speed settings on load (#6937) 2024-07-11 00:55:34 +01:00
session-id.cc Add CI configuration for clang-tidy on Windows (#6997) 2024-07-16 22:13:29 +01:00
session-id.h
session-thread.cc Add CI configuration for clang-tidy on Windows (#6997) 2024-07-16 22:13:29 +01:00
session-thread.h Add CI configuration for clang-tidy on Windows (#6997) 2024-07-16 22:13:29 +01:00
session.cc chore: misc code cleanups (#6927) 2024-07-14 01:37:55 +01:00
session.h feat: configurable client `reqq` (#7030) 2024-08-23 21:46:37 -05:00
settings.cc chore: iwyu (#6864) 2024-05-27 17:36:02 -05:00
settings.h refactor: add virtual destructor to the polymorphic Settings class (#6786) 2024-05-25 15:20:40 -05:00
stats.cc
stats.h
subprocess-posix.cc refactor: fix cppcoreguidelines-avoid-do-while warnings (#6527) 2024-01-20 16:56:42 -06:00
subprocess-win32.cc Add CI configuration for clang-tidy on Windows (#6997) 2024-07-16 22:13:29 +01:00
subprocess.h
timer-ev.cc
timer-ev.h
timer.h
torrent-ctor.cc fix: clang-tidy-19 warnings (#6597) 2024-02-13 10:42:19 -06:00
torrent-ctor.h
torrent-files.cc Refactor async torrent removal logic (#7059) 2024-08-13 06:19:36 +01:00
torrent-files.h Fails with an error if data removal was not possible (#6055) 2024-08-13 05:26:09 +01:00
torrent-magnet.cc fix: possible heap-use-after-free with magnet links (#6815) 2024-05-24 15:50:01 -05:00
torrent-magnet.h chore: iwyu (#6864) 2024-05-27 17:36:02 -05:00
torrent-metainfo.cc fix: restore portable file path check (#6853) 2024-05-25 10:08:53 -05:00
torrent-metainfo.h fix: restore portable file path check (#6853) 2024-05-25 10:08:53 -05:00
torrent.cc fix: various pex flag bugs and cleanup (#6917) 2024-09-08 22:05:03 -05:00
torrent.h fix: various pex flag bugs and cleanup (#6917) 2024-09-08 22:05:03 -05:00
torrents.cc perf: prefer small containers (#6542) 2024-01-27 09:33:12 -06:00
torrents.h
tr-arc4.h
tr-assert.cc fix: clang-tidy-19 warnings (#6597) 2024-02-13 10:42:19 -06:00
tr-assert.h
tr-buffer.h
tr-dht.cc Add CI configuration for clang-tidy on Windows (#6997) 2024-07-16 22:13:29 +01:00
tr-dht.h fix: various DHT bugs (#6569) 2024-02-04 12:18:01 -06:00
tr-getopt.cc
tr-getopt.h
tr-lpd.cc chore: iwyu (#6864) 2024-05-27 17:36:02 -05:00
tr-lpd.h
tr-macros.h refactor: remove TR_PATH_DELIMITER (#6618) 2024-02-18 01:47:12 -06:00
tr-popcount.h
tr-strbuf.h
tr-udp.cc fix: misc µTP trace log fixes (#6929) 2024-07-14 11:55:37 +01:00
tr-utp.cc fix: misc µTP trace log fixes (#6929) 2024-07-14 11:55:37 +01:00
tr-utp.h feat: µTP delayed ack (#6586) 2024-03-24 20:48:23 -05:00
transmission.h Refactor async torrent removal logic (#7059) 2024-08-13 06:19:36 +01:00
utils-ev.cc
utils-ev.h
utils.cc refactor: new `tr_variant` API in `transmission-remote` and other cleanup (#6798) 2024-08-17 20:04:49 +01:00
utils.h refactor: new `tr_variant` API in `transmission-remote` and other cleanup (#6798) 2024-08-17 20:04:49 +01:00
utils.mm
values.h
variant-benc.cc
variant-json.cc fix: `tr_variant_serde::parse_json()` bug fixes (#6901) 2024-07-17 02:34:13 +01:00
variant.cc refactor: new `tr_variant` API in `transmission-remote` and other cleanup (#6798) 2024-08-17 20:04:49 +01:00
variant.h refactor: new `tr_variant` API in `transmission-remote` and other cleanup (#6798) 2024-08-17 20:04:49 +01:00
verify.cc refactor: aggregate crypto handles when computing digests (#6662) 2024-03-04 16:59:51 -06:00
verify.h Default initialize sleep callback duration in tr_verify_worker (#6789) 2024-05-24 15:51:16 -05:00
version.h.in fix: Sparkle Version Comparator (#5263) 2024-03-17 16:23:39 -05:00
watchdir-base.h
watchdir-generic.cc
watchdir-inotify.cc fix: clang-tidy-19 warnings (#6597) 2024-02-13 10:42:19 -06:00
watchdir-kqueue.cc chore: iwyu (#6864) 2024-05-27 17:36:02 -05:00
watchdir-win32.cc Add CI configuration for clang-tidy on Windows (#6997) 2024-07-16 22:13:29 +01:00
watchdir.cc Add CI configuration for clang-tidy on Windows (#6997) 2024-07-16 22:13:29 +01:00
watchdir.h
web-utils.cc feat: dual stack udp tracker support (#6687) 2024-05-26 15:43:55 -05:00
web-utils.h feat: dual stack udp tracker support (#6687) 2024-05-26 15:43:55 -05:00
web.cc Add CI configuration for clang-tidy on Windows (#6997) 2024-07-16 22:13:29 +01:00
web.h
webseed.cc fix: limit number of bad pieces to accept from a webseed (#6875) 2024-08-24 14:18:12 -05:00
webseed.h refactor: convert `tr_webseed` to C++ interface (#6708) 2024-04-02 09:31:20 -05:00