* 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: add tr_rand_obj()
There are a lot of places in the codebase where we need to populate
an integral type or a fixed-size array with random data. To do this,
we instantiate a local on the stack, fill it with tr_rand_buffer(),
and then use it.
This PR creates a helper function to make this a one-liner.
* 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
* Fix TR_ASSERT equality
* Further workaround to the assertions from tr-dht
* Update libtransmission/tr-dht.cc
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* 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
* Use std::unique_ptr to manage UDP core object
N.B.: it's no longer valid to call socket adjustments quirks from
tr_sessionSetUTPEnabled() because the corresponding object may be
not created yet. We have to create (or re-create) it explicitly
(like it's done in tr_sessionSetDHTEnabled()) or just set
is_utp_enabled_ flag of the session and assume that socket
adjustments will be done later when the object is constructed.
* 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