Commit Graph

14801 Commits

Author SHA1 Message Date
acchang 5945b7d94b
added info on Windows compatibility (#3729) 2022-09-08 09:49:20 -05:00
Dmitry Antipov 828d008f82
daemon: use evsignal-based signal handling on POSIX systems (#3782)
If signalfd(2) interface is not available (i.e. everywhere
except Linux), use evsignal interface to manage signals.
2022-09-08 04:23:54 -05:00
Charles Kerr 9fb590d3f5
fix: recent coverity warnings (#3788)
* fix: suppress intentional USE_AFTER_FREE in tests

* fix: unnecessary field check

* fix: in ~tr_verify_worker(), release mutex lock before waiting
2022-09-07 19:24:56 -05:00
Mike Gelfand b41501eeb8
Switch to Gtk::Builder for all UI in GTK client (#3781)
* Move CSS definitions to resources

* Add Gtk::Builder helpers

* Switch StatsDialog to Gtk::Builder

* Switch RelocateDialog to Gtk::Builder

* Switch OptionsDialog to Gtk::Builder

* Switch MakeDialog to Gtk::Builder

* Switch FilterBar to Gtk::Builder

* Switch MainWindow to Gtk::Builder

* Switch MessageLogWindow to Gtk::Builder

* Switch DetailsDialog to Gtk::Builder

* Switch PrefsDialog to Gtk::Builder

* Fixup translatable strings

Since this branch was brewing for a while, changes happened in the meantime.
2022-09-08 01:25:04 +03:00
Charles Kerr c000311b80
fix: qt open magnet dialog munges magnet url (#3787) 2022-09-07 16:38:34 -05:00
Dmitry Antipov 050ee1cbbd
daemon: use signalfd-based signal handling if available (#3778)
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>
2022-09-07 15:12:35 -05:00
Dmitry Antipov 2bcb8f8535
Do not fsync descriptor referred to a tty (#3785)
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>
2022-09-07 13:44:31 -05:00
Charles Kerr 806a6382d7
fixup new minor warnings (#3786)
* fixup! Add fallback for copy_file_range EXDEV error (#3756)

* fixup! refactor: use readability-identifier-naming in clang-tidy (#3784)
2022-09-07 12:41:01 -05:00
Charles Kerr 1782dc6d7a
refactor: use readability-identifier-naming in clang-tidy (#3784) 2022-09-07 11:04:28 -05:00
Xist12gh 32a4709b1a
Add fallback for copy_file_range EXDEV error (#3756)
* 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
2022-09-07 00:25:52 -05:00
Charles Kerr d17341d784
refactor: constify (#3780) 2022-09-06 12:52:58 -05:00
orbital-mango 4e22109113
Qt: Allow piece size selection on torrent creation (#3768) 2022-09-06 10:17:47 -05:00
orbital-mango 488d4a993f
GTK: increase torrent piece size limit as per #3402 (#3771) 2022-09-06 08:43:27 -05:00
Charles Kerr 82212ff1d8
refactor: move the verify worker thread into a wrapper class (#3775) 2022-09-05 23:43:59 -05:00
Dmitry Antipov 4adcb73bb0
refactor: prefer std::array over plain C array in tr-dht.cc (#3765) 2022-09-05 19:06:49 -05:00
Dmitry Antipov 44c5d3edbd
refactor: fold common daemon code into C++ class (#3767)
Fold common daemon code into Daemon class, adjust related bits.

Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
2022-09-05 16:28:15 -05:00
Dmitry Antipov 72a1696900
refactor: fix warning issued during LTO build (#3766)
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>
2022-09-05 10:47:45 -05:00
Charles Kerr 8eab7d3ae7
chore: remove dead "fast set" code (#3764)
* chore: remove old fast set code

* chore: remove TR_SHA1_DIGEST_LEN declaration

* chore: remove TR_SHA256_DIGEST_LEN declaration
2022-09-05 08:55:17 -05:00
Charles Kerr ae74a13eb1
test: improve file-win32, file-posix test coverage (#3761) 2022-09-04 19:40:34 -05:00
orbital-mango 339b9580cf
transmission-edit: Allow changes to torrent source flag (#3760) 2022-09-04 18:12:23 -05:00
wiz78 1bba2a8c61
fix tr_session::shouldDeleteSource() (#3759)
shouldDeleteSource() was returning the same value as shouldPauseAddedTorrents()

Co-authored-by: Simone Tellini <simone@tellini.info>
2022-09-04 12:05:39 -05:00
Mike Gelfand 02af4c2982
Don't crash when hiding top-level windows (#3757)
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.
2022-09-04 16:52:35 +03:00
Mike Gelfand ea14f91ac8
Sync translations (#3755)
* Sync translations with code

* Sync translations with Transifex
2022-09-04 13:59:04 +03:00
Charles Kerr 581349ac37
refactor: simplify tr_clientForId() (#3751)
* refactor: use make buf_append() a template function; use libfmt

* refactor: make charint() use a lookup table

* chore: use std::equal instead of strncmp
2022-09-03 02:13:22 -05:00
L2501 22669dda5e
Add Advanced Download Manager & LibreTorrent client names (#3750) 2022-09-02 12:37:25 -05:00
bexnoss 5782847601
fix(gtk): send key events directly to widgets (#3720)
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.
2022-09-02 11:21:43 -05:00
Charles Kerr 1062ae8f1f
refactor: split tr_parseNum inout var into two vars (#3748)
build: re-enable cert-err34-c warning
2022-09-02 01:04:09 -05:00
Charles Kerr 6d721fe32f
perf: check torrrent seed ratio less frequently (#3747) 2022-09-01 21:16:43 -05:00
Charles Kerr b01eebdaf4
refactor: tr_peer_event (#3746) 2022-09-01 16:37:11 -05:00
Charles Kerr 3b692e1aa0
refactor: reduce http announce timeout interval to 45 seconds (#3745) 2022-09-01 15:11:51 -05:00
Charles Kerr 6ca0ce683a
refactor: more constexpr (#3744)
Make more simple functions constexpr where possible.
2022-08-31 17:33:51 -05:00
luzpaz f8203148f0
fix: fix various user facing and non-user facing typos (#3743)
* fix: fix various user facing and non-user facing typos

Found via `odespell -q 3 -S ./third-party,*.po,*.ts -L filetest,inout`
2022-08-31 11:28:54 -05:00
Dachtire 6f0d520daf
web: fix deps dir in CMakeLists.txt (#3736) 2022-08-31 09:31:29 -05:00
IMurzich 272f361237
Fix a progressBar direction for QT 5.15 (#3739) 2022-08-31 08:36:16 -05:00
Charles Kerr ea05474464
perf: make methods constexpr (#3742) 2022-08-30 23:17:23 -05:00
Charles Kerr d130f7d593
refactor: prefer std::unique_ptr over std::shared_ptr (#3741) 2022-08-30 19:30:47 -05:00
Charles Kerr b989b72c0f
refactor: remove unnecessary default destructors (#3740) 2022-08-30 14:31:40 -05:00
Charles Kerr b7ea4d9f04
refactor: tr_peerIo ref, unref (#3735)
* refactor: replace manual peerIo refcounting with std::shared_ptr
2022-08-30 12:38:30 -05:00
Charles Kerr 7c014e3256
Refactor/tr peer io member funcs (#3734)
* 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
2022-08-29 15:58:18 -05:00
Charles Kerr 0ed595ca0e
refactor: tr_peerIo read buffer (#3732)
* 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
2022-08-29 13:33:08 -05:00
Charles Kerr cee339e10d
refactor: remove tr_removeElementFromArray() (#3731) 2022-08-28 21:51:26 -05:00
Charles Kerr 0360cfbf72
refactor: remove tr_ctorSetBandwidthPriority() from public API (#3730)
it is only used via RPC, so remove it from transmission.h
2022-08-28 19:04:29 -05:00
Charles Kerr 072bb0322c
refactor: remove tr_quark_get_string() (#3728) 2022-08-28 16:17:07 -05:00
Charles Kerr 4f3f0ccbeb
refactor: remove unused function tr_sys_file_seek() (#3727)
* refactor: remove TR_SYS_FILE_CREATE_NEW

* refactor: remove tr_sys_file_seek()
2022-08-28 14:10:00 -05:00
Charles Kerr 6c5fda2021
refactor: use std::ifstream in torrent-magnet (#3726) 2022-08-28 12:33:58 -05:00
Charles Kerr 185f1f96a5
test: add torrent-magnet tests (#3725) 2022-08-27 17:06:20 -05:00
Charles Kerr db3467b553
refactor: remove tr_sys file_map_for_reading() (#3723) 2022-08-27 14:05:21 -05:00
Charles Kerr 6e44adabf1
Revert "fix(gtk): fix conflicting hotkeys (#2201)" (#3718)
This reverts commit a0305a3a12.
2022-08-26 19:45:46 -05:00
Charles Kerr 291d2fcb9b
fix: when renaming local data files fails, set the torrent error and pause the torrent (#3717) 2022-08-26 18:57:44 -05:00
Charles Kerr 9e07b6f4c5
fixup! refactor: modernize cache.cc (#3108) (#3715) 2022-08-26 14:46:46 -05:00