* migrate macOS client to using tr_sessionLoadTorrents
With this PR the macOS client now loads torrents at startup using `tr_sessionLoadTorrents`
The history file is used in tandem to provide macOS specific additions
network.target does not guarantee interfaces are fully configured, which
can result in bound addresses not being available when the daemon
starts. This leads to errors on start-up and potentially broken
connectivity.
network-online.target does provide these guarantees, but needs a
slightly different dependency configuration with Wants= on top of After=
(cf. systemd.special(7)).
Closes#2720.
* Use std::unique_ptr for bindAddress
* fixup: unix socket implementation changes
Assortment of changes and comments from #2574
- actually assign variables in the tr_rpc_address union for ipv4 and
ipv6
- use std::size() instead of std::string.length()
- add [[maybe_unused]] to bindUnixSocket() args for Windows
- fix error log for windows to to actually print a string instead of
an enum int
- use C++ style cast for ecvonnlistener_new_bind()
- refactor rpc URL log line to only substitute a single string
- remove redundant tr_rpc+address_is_valid() check
* change TrUnixSocketPrefix to std::string_view
This allows for removing runtime overhead of strlen() in a few places.
Co-authored-by: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com>
Co-authored-by: LaserEyess <LaserEyess@users.noreply.github.com>
This _may_ solve the problem by calling tier.useNextTracker(); but if not, it also adds new assertions to try and fail sooner if the announcer gets into a bad state.
* fixup! refactor: tr_webseed simplification (#2613)
call connection_limiter.taskStarted in the right place
* perf: put web thread to sleep when inactive
Instead of giving the entire magnet link, which can be too long to be
readable, give the magnet's display name (if available) or the info hash
as a fallback.
Fixes#1217.
* Fix display of size values in web interface:
The web interface rounded large number values down using Math.floor(),
causing the web interface to display faulty torrent/download sizes.
A torrent of size 1,92 GB (915 pieces @ 2,1 MB) was shown as "1GB".
After about half the download was done, the UI showed "1GB of 1GB (55%)", which is rather irritating.
The fix removes the `Math.floor()` and adds fractions to the larger size values.
* 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>