* 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>
* refactor: don't loop in `tr_handshake::can_read()`
* fix: return `READ_NOW` after handshake success
* code review: more accurate comment wording
* Revert "refactor: don't loop in `tr_handshake::can_read()`"
This reverts commit 4f33520cba6a38171ed203a071158aa37ddcd325.
* refactor: convert `ReadState` to enum class
* refactor: use new `ReadState` value to break out of loop
* fix: return read buffer size in libutp read buffer size callback
* refactor: clamp amount of data processed in `can_read_wrapper()`
* chore: housekeeping
* refactor: call `utp_read_drained()` in on-read callback
so that uTP acks can be sent out in a more timely fashion
* perf: use libtransmission::StackBuffer in variant-benc
* perf: use libtransmission::StackBuffer in variant-json
* perf: use libtransmission::StackBuffer in handshake
* perf: use libtransmission::StackBuffer in peer-msgs
* perf: use libtransmission::StackBuffer in peer-io
* Revert "perf: use libsmall in libtransmission, pt 3 (#5653)"
This reverts commit 3b03494580.
* Revert "perf: use small in libtransmission (#5650)"
This reverts commit 559f6f0332.
* refactor: use BufferReader, BufferWriter in peer-socket
* feat: expose GrowthFactor in tr-buffer
* perf: choose better defaults for the peer message buffers
* chore: sync tests
* refactor: use small::map in ActiveRequests::Impl
* 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
* refactor: group related functions together in the source
* refactor: make tr_peerIo::decrypt() private
* refactor: make tr_peerIo::is_seed() private
* refactor: remove unused tr_isPeerIo()
* refactor: move tr_tracker_http_announce() helper funcs into their own namespace
* refactor: move tr_globalIPv6() helper funcs into their own namespace
* refactor: move tr_address_is_valid_for_peers() helper funcs into their own namespace
* refactor: make tr_address_compare() a private method
* refactor: rename tr_address::isIPv4() to is_ipv4()
* refactor: use snake_case for tr_address methods
* refactor: make tr_address_is_valid_for_peers() a member function
* refactor: make tr_peer_socket.type private
* refactor: reimplement tr_peerIo::address() as a wrapper around tr_peer_socket::address()
* refactor: remove tr_address, tr_port from tr_peerIo
* refactor: replace tr_netClosePeerSocket() with tr_peer_socket::close()
* refactor: make tr_peerIoSetEnabled() a member method
* refactor: make tr_peerIoFlushOutgoingProtocolMsgs() a member method
* refactor: make tr_peerIoFlush() a member method
* refactor: make tr_peerWriteBytes() a member method
* refactor: make tr_peerWriteBuf() a member method
* refactor: make tr_peerIoGetWriteBufferSpace() a member method
* chore: remove unused declaration
* refactor: make tr_peerIoUtpInit() a member method
* refactor: make tr_peerIoNew() a member method
* refactor: make tr_peerIoNewOutgoing() a member method
* refactor: make tr_peerIoNewIncoming() a member method
* refactor: make tr_peerIoReadBytes() a member method
* refactor: make tr_peerIoReadUint8() a member method
* refactor: make tr_peerIoReadUint16() a member method
* refactor: make tr_peerIoReadUint32() a member method
* refactor: make tr_peerIoSetIOFuncs() a member method
* refactor: make tr_peerIoReconnect() a member method
* refactor: make tr_peerIoClear() a member method
* refactor: make tr_peerIoDrain() a member method
* refactor: move evbuffer_add_hton_16() impl to cc