If signalfd(2) interface is available, prefer it over traditional signal
handlers. This is mostly intended to drop dedicated signal handling thread
and hook signal processing into libevent event loop in the most natural way.
Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
When transmission-daemon is running with '--foreground' option,
log messages are emitted to standard error, which may be referred
to a tty. Since an attempt to fsync() tty is always an error,
an extra isatty() precaution should be applied.
Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
* Invalid cross-device: copy_file_range changed in Kernel 5.18 (#3654)
* allow fallback to other copy routines based on errno
* tiered kernel copy routines are tried in runtime now when available
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>
Current window management approach results in secondary windows being
destroyed once they are hidden. Since those windows are managed by
`std::unique_ptr<>`, we can't just [temporarily] increase their refcount
to avoid use-after-free situation, so retrieve updated top-level windows
list every time we hide one instead.
* refactor: use make buf_append() a template function; use libfmt
* refactor: make charint() use a lookup table
* chore: use std::equal instead of strncmp
The default behavior is to send them to the window first to activate
mnemonics and accelerators. Some accelerators conflict with text
selection hotkeys (like CTRL+A to select all torrents), this fixes that
conflict.
* refactor: make tr_peerIoSetEnabled() a member method
* refactor: make tr_peerIoFlushOutgoingProtocolMsgs() a member method
* refactor: make tr_peerIoFlush() a member method
* refactor: make tr_peerWriteBytes() a member method
* refactor: make tr_peerWriteBuf() a member method
* refactor: make tr_peerIoGetWriteBufferSpace() a member method
* chore: remove unused declaration
* refactor: make tr_peerIoUtpInit() a member method
* refactor: make tr_peerIoNew() a member method
* refactor: make tr_peerIoNewOutgoing() a member method
* refactor: make tr_peerIoNewIncoming() a member method
* refactor: make tr_peerIoReadBytes() a member method
* refactor: make tr_peerIoReadUint8() a member method
* refactor: make tr_peerIoReadUint16() a member method
* refactor: make tr_peerIoReadUint32() a member method
* refactor: make tr_peerIoSetIOFuncs() a member method
* refactor: make tr_peerIoReconnect() a member method
* refactor: make tr_peerIoClear() a member method
* refactor: make tr_peerIoDrain() a member method
* refactor: move evbuffer_add_hton_16() impl to cc