* refactor: make tr_session.private_peer_port a private field
chore: make tr_session.public_peer_port a private field
* refactor: make tr_session.web_ a private field
* refactor: make tr_session.lpd_ a private field
* refactor: make tr_session.bind_ipv4_ private
refactor: make tr_session.bind_ipv6_ private
* refactor: make tr_session.bandwidth_groups_ private; add const accessor
* refactor: make tr_session.port_forwarding_ private
* refactor: make tr_session.peerMgr private pt 1: add tr_session::addIncoming()
* refactor: make tr_session.peerMgr private pt 1: add tr_session::addTorrent()
* refactor: make tr_session.peer_mgr_ private
* refactor: make tr_session.setPeerPort() private
Fix the following warning emitted when using -flto with GCC 12.2.1:
libtransmission/announcer.cc:929:8: warning: type ‘struct announce_data’ violates the C++ One Definition Rule [-Wodr]
929 | struct announce_data
| ^
libtransmission/announcer-http.cc:299:8: note: a different type is defined in another translation unit
299 | struct announce_data
| ^
libtransmission/announcer.cc:931:15: note: the first difference of corresponding definitions is field ‘tier_id’
931 | int const tier_id;
| ^
libtransmission/announcer-http.cc:301:22: note: a field with different name is defined in another translation unit
301 | tr_sha1_digest_t info_hash;
|
Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
* 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: tr_ctorSaveContents takes a string_view filename
* refactor: remove tr_ctorSaveMagnetContents
* refactor: announce_list::save takes a std::string_view
* refactor: magnet() takes an OutputIt arg
Generate the magnet link URL into an output iterator
* refactor: remove deprecated calls to tr_http_escape
* refactor: tr_torrent.torrentFile takes an OutputIterator
* refactor: tr_torrent.torrentFile returns a tr_pathbuf
* refactor: tr_torrent_metainfo.makeFilename returns a tr_pathbuf
* refactor: use tr_urlbuf in announcer-http
* refactor: add fetch options object to tr_webRun()
Fold `tr_webRun()`, `tr_webRunWithCookies()`, and `tr_webRunWebseed()`
into a single API that takes an options argument that callers can
customize to their needs.
Also does a surface cleanup pass to the tr_webseed and tr_web internal
structures, e.g. making fields const where possible, not using raw
pointers, and making some fields private.
This revision is still full of code smells. Refactoring the entire
system is overwhelming, so instead I'm doing it in incremental steps.