* Revert "refactor: remove tr_sessionGetConfigDir() (#3506)"
This reverts commit c50da43ae0.
* Revert "fix: do not leak in tr_getWebClientDir() (#3502)"
This reverts commit 5a75e37033.
* 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: use semantic type tr_torrent_type_t in libtransmission
* refactor: use semantic type tr_torrent_type_t in gtk client
* refactor: use semantic type tr_torrent_type_t in qt client
* 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()
This change has been in the back of my head since I made pull request #2984.
Dropping the zero does not change any of the behaviour.
And this way the format is more familiar to users of the unixoid
octal permissions. Those permissions would not be specified with
a leading zero.
If they were specified with a leading zero, it would mean that some
special permission bits (setuid, setgid or sticky) should be cleared.
Thus removing the leading zero in our settings format removes two
cases of possible confusion.
Additionally the permissions are always padded to three digits to avoid
strangely looking permission strings.
* Modernize blocklist.cc to C++
* Modernize blocklist.cc: Renamed BlocklistFile struct and moved IPv4 range struct inside it
Modernize bandwidth.cc: Review notes; Promote container of blocklists in session to vec of unique_ptrs
* Support specifying the umask as a string representing an octal number.
* Save the umask as a string representing an octal number.
* Support specifying the IPC socket permission as a string representing an octal number.
* Save the IPC socket permission as a string representing an octal number.
* Add a `base` parameter to `tr_parseNum()` for specifying the radix.
* refactor: re-enable cert-err33-c clang-tidy warning
* refactor: use fmt::chrono in transmission-remote
* refactor: use fmt::chrono in transmission-show
* refactor: use fmt::chrono in GTK details dialog
* refactor: use fmt::chrono in tr_session
* refactor: remove tr_localtime_r
* refactor: remove tr_gmtime_r
* refactor: implement FileTreeItem::children_ with a std::vector
* fix: std::move should not be called on forwarding reference
* fix: uninitialized scalar variable
* fix: unchecked return value from library
* fix: dereference before null check
* fix: unchecked return value from library
* fix: unchecked return value from library
* fixup! refactor: implement FileTreeItem::children_ with a std::vector
* fix: signed-unsigned comparison in libtransmission tests
* fix: avoid unnecessary copy by using const reference
* fix: function should be declared const
* refactor: use fmt::format to build log timestamps
* fix: use init-statement to reduce variable scope
* fixup! refactor: use fmt::format to build log timestamps
* fix: remove tau_tracker destructor for rule-of-zero
* fix: remove tr_peerIo destructor for rule-of-zero
* Revert "fix: dereference before null check"
This reverts commit cd78967815.
* fix: signed-unsigned comparison in libtransmission tests
* fix: use init-statement to reduce variable scope
* fix: extract nested code block into separate method
* fix: extract nested code block into separate method
* fix: extract nested code block into separate method
* fix: use init-statement to reduce variable scope
* fix: extract nested code block into separate method
* fix: signed-unsigned comparison in libtransmission tests
* fixup! fix: extract nested code block into separate method
* fix: mark possibly-unused as [[maybe_unused]]
* fix: invalid stack memory reference in tr_found_file_t
* fix: signed-unsigned comparison in libtransmission tests
* fix: rename variable to avoid shadow warning w/UTP
* fix: add default dtor for tr_strbuf
* fix: implicit conversion may lose precision
* fix: use init-statement to reduce variable scope
* fix: implicit conversion may lose precision
* fix: extract the assignment from this expression
* fix: use init-statement to reduce variable scope
* fix: use init-statement to reduce variable scope
* fix: do not mix public and private data members
* fix: add a condition to cv.wait call
* fix: do not throw uncaught exceptions in destructor
* 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
* chore: fix shadowed variable warning
"byte" is declared by a third-party UTP header
* refactor: tr_variantFromFile, tr_variantToFile take a string_view filename
* Support binding the RPC to a Unix socket on *nix
This commit adds unix socket support for a RPC. Some refactoring was
required in order to split out the RPC server's address struct from the
normal network address struct used for peers. It would cause
unacceptable overhead to add the unix socket length to the union.
Co-authored-by: Malte Voos <malte@malvo.org>
* add RPC socket mode to control unix socket perms
Unix socket permissions are important to control for security reasons,
and libevent defaults to 0755, which may not be what users want.
Co-authored-by: LaserEyess <LaserEyess@users.noreply.github.com>
Co-authored-by: Malte Voos <malte@malvo.org>
Add a getter/setter for torrent announce URLs as text that can be copied
and pasted: one URL per line, with a blank line between tiers.
C API: tr_torrentGetTrackerList() and tr_torrentSetTrackerList()
RPC APi: `trackerList` in `torrent-get` and `torrent-set`.
This deprecates `trackerAdd`, `trackerRemove`, and `trackerEdit`
from the RPC API.
Pass the bind-address-ipv4 to upnpDiscover to allow for upnp to only
use the interface specified. Prevents upnp packet leaks.
Authored-by: LaserEyess <lasereyess@lasereyess.net>
* refactor: include <memory> when using shared_ptr or unique_ptr
* refactor: include <cstdio> iff we use it
* refactor: include <cstring> iff we use it
* refactor: include <cstdlib> iff we use it
* refactor: include <string_view> or <string> iff we use it
* refactor: include <array> iff we use it
* refactor: include <ctime> iff we use it
* refactor: include <cctype> iff we use it
* refactor: misc #include cleanups in libtransmission