* refactor: add a Mediator class to decouple tr_session and tr_port_forwarding
* refactor: add tr_port_forwarding::Mediator::privatePeerPort()
* refactor: add tr_port_forwarding::Mediator::onPortForwarded()
* chore: avoid unnecessary include of timer.h in other headers
* refactor: use a uniform timerMaker() API in mediators
* chore: use typesafe sin_addr assignment instead of memcpy()
* refactor: make tr_dhtPrintableStatus private
* refactor: make tr_dhtStatus() private
* refactor: make tr_dht status enum private
* refactor: add safety mutex wrapper around libdht API calls
* refactor: make tr_dht::Status an enum class
* refactor: rename private functions
* refactor: const correctness
* refactor: use typesafe assignment instead of memcpy
* refactor: tr_session does not directly call tr_dht
* refactor: tr_dhtPort() returns std::optional
* refactor: use tr_address::fromCompact4 in tr-dht.cc
* 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
* refactor: tr_torrentGetMetadataPiece() returns an optional vector
* refactor: use tr_pathbuf in create_temp_path()
* refactor: use tr_pathbuf in win32 create_temp_path()
* refactor: use std::vector in isPeerInteresting()
* refactor: remove tr_new0 from tr_peerMgrPeerStats()
* refactor: remove tr_new0 from rechokeUploads()
* refactor: silence clang nullptr dereference warning
* refactor: make tr_natpmp a C++ class
* refactor: use std::string in tr_log_message
* feat: add convenience variants of TimerMaker::create()
* refactor: use libtransmission::Timer in peer-mgr
* refactor: use libtransmission::Timer in peer-msgs
* refactor: use libtransmission::Timer in tr-utp
* refactor: use libtransmission::Timer in tr-dht
* refactor: use libtransmission::Timer in port-forwarding
* refactor: use libtransmission::Timer in webseed
* refactor: use libtransmission::Timer in tr-lpd
* refactor: use libtransmission::Timer in rpc-server
* chore: remove unused function tr_timerAdd()
* chore: remove unused function tr_gettimeofday()
* fixup! chore: remove unused function tr_timerAdd()
* fixup! refactor: use libtransmission::Timer in port-forwarding
* refactor: use std::string in tr_watchdir_inotify_on_event()
* refactor: add template tr_variantFromBuf() variant
if it has .data() and .size() it is good
* refactor: remove tr_address_compare()
* refactor: remove tr_address_to_string()
* refactor: remove NUM_TR_AF_INET_TYPES
* refactor: replace tr_sessionGetPublicAddress with tr_session::getPublicAddress()
* refactor: tr_peerIo() takes tr_address by value
* refactor: replace tr_sessionIsAddressBlocked with tr_session::isAddressBlocked()
* refactor: tr_peerMgrAddIncoming now takes tr_address by value
* refactor: replace tr_address_is_valid_for_peers() with tr_address.isValidForPeers()
* refactor: tr_netOpenPeerSocket takes tr_address by value
* refactor: remove tr_generateAllowedSet()
* refactor: setup_sockaddr takes a tr_address by value
* refactor: tr_netBindTCP() takes a tr_address by value
* refactor: tr_dhtAddNode() takes a tr_address by value
* refactor: remove tr_address_from_string()
* refactor: rename tr_address.isValidForPeers() to .isValidPeerAddress()
* refactor: replace tr_address_from_sockaddr_storage() with tr_address::fromSockaddrStorage()
* refactor: minor cleanup to tr_address::readable()
* refactor: add tr_peerMsgs.percentDone()
This moves the `progress` and `have` fields from the `tr_peer` parent
class down into BitTorrent peer subclass, since webseeds by definition
are seeds and have everything.
* refactor: use preferred naming for class members
snake_case for variables, camelCase for methods
* Modernize cache.cc: Convert tr_cache to a class
* Modernize cache.cc: Replaced ptrArray with vector
* refactor: Cache now takes a tr_torrents reference
* refactor: add Key type to Cache
* refactor: avoid std::back_inserter
* refactor: add Cache::flushOldest()
* refactor: make tr_peerIoGetAddress() a member function
* refactor: make tr_peerIo.addr a private field
* refactor: make tr_peerIoIsIncoming a member function
* refactor: make tr_peerIoHasBandwidthLeft a member function
* refactor: make tr_peerIoGetPieceSpeed_Bps a member function
* refactor: make tr_peerIoSupportsFEXT() a member function
* refactor: mark tr_peerIo::supportsDHT nodiscard
* refactor: update naming style for tr_peerIo fields
* refactor: make tr_peerIo.is_seed a private field
* fix: invalid tr_peerMsgsImpl::prefetchCount value
This count could get corrupted due to imprecise bookkeeping when
processing peers' cancel messages. This PR replaces the field with
a `prefetched` flag in the struct that represents a peer request.
This approach has simpler code, simpler logic, and is harder to break.