* refactor: tr_rpc_request_exec_json takes a std::function callback
* refactor: tr_rpc_request_exec_json callback takes a tr_variant&&
* refactor: use new tr_variant API in rpcimpl.cc
* refactor: tr_rpc_request_exec_json() now takes a const& to the request
* fixup! refactor: use new tr_variant API in rpcimpl.cc
* chore: rename function to tr_rpc_request_exec()
* chore: remove unused DetailsDialog::Impl::build_torrent_ids_variant_list()
* refactor: minor copyediting in rpcimpl.cc getTorrents()
* refactor: split handler methods between sync, async
* refactor: remove unused args_out param from AsyncHandlers
* chore: fix new readability-inconsistent-declaration-parameter-name warning
* refactor: do not use tr_strlcpy() in tr_strratio()
* refactor: do not use tr_strlcpy() in bindUnixSocket()
* refactor: do not use tr_strlcpy() in trackerView()
* chore: remove tr_strlcpy() unit tests
* chore: remove tr_strlcpy()
* chore: remove -DHAVE_STRLCPY from Xcode build
* fixup! refactor: do not use tr_strlcpy() in trackerView()
chore: fix copypaste bug
* 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
* chore: rename tr_strvContains to tr_strv_contains
* chore: rename tr_strvStartsWith to tr_strv_starts_with
* chore: rename tr_strvEndsWith to tr_strv_ends_with
* chore: rename tr_strvSep to tr_strv_sep
* chore: rename tr_strvStrip to tr_strv_strip
* chore: rename tr_strvToBuf to tr_strv_to_buf
* refactor: rename tr_saveFile() to tr_file_save()
rename tr_loadFile() to tr_file_read()
rename tr_moveFile() to tr_file_move()
* refactor: rename tr_parseNum() to tr_num_parse()
refactor: rename tr_parseNumRange() to tr_num_parse_range()
* chore: group related functions together in header
The changes in #5523 made two errors in the new implementation
1. tr_unix_address::to_string() got the ternary check backwards, leading
to always printing an empty string when the address is valid.
2. The inputs to tr_strvStartsWith in tr_unix_address::from_string()
were backwards as well, leading to the check failing for valid
socket addresses.
Co-authored-by: LaserEyess <LaserEyess@users.noreply.github.com>
* fixup: dedup tr_rpc_address with tr_address
tr_rpc_address was duplicating a lot of work that tr_address was doing a
lot better. Fall back to using tr_address for ipv4/ipv6 connections and
make a tr_unix_addr for handling unix sockets.
* remove unnecessary functions
* Automatically (re)order include directives (GTK client)
Include our headers first to ease IWYU enforcement.
* Fix includes missing from headers (GTK client)
* Fix build on Mac after includes reordering
* 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