* refactor: remove the tr_error** idiom
* fix: tr_error::message() is only constexpr in c++20 and up
* chore: silence a couple of g++-12 Wshadow warnings
* refactor: minor decoupling in peer-mgr
Pass a tr_torrents& and TimerMaker& into the tr_peerMgr and HandshakeMediator
constructors so they can be used directly instead of via tr_session.
No functional changes.
* refactor: in HandshakeMediator, make the session reference const
* 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: 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: 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()
* fix: ESPIPE "illegal seek" error while seeding
The root cause is createSocket returning `{}` instead of `TR_BAD_SOCKET`
when we have too many peers in use. This defaulted to fd 0, which wound
up closing stdin.
Commit also includes some const-correctness changes made while tracking
the problem down.
Port libtransmission to C++. This PR doesn't refactor everything to c++.
Its code changes are only what was necessary to compile and link as c++.
See libtransmission/README.md for details on how to submit modernization
patches!
Co-authored-by: Mike Gelfand <mikedld@mikedld.com>