Commit Graph

5509 Commits

Author SHA1 Message Date
A Cœur 4ea9c87fea
fix: some typos (#3904) 2022-10-13 09:35:10 -05:00
A Cœur 33afdc32f9
fix: "Nullptr with nonzero offset" (#3941) 2022-10-11 16:52:13 -05:00
Mike Gelfand f1f55cc3df
Sync translations (#3939)
* Sync translations with code

* Sync translations with Transifex

* Remove Mac menu title that isn't displayed and shouldn't be translated

* Add context to logging level strings in GTK client

* Use "µTP" consistently in code

* Use ellipsis instead of three docs in Qt client strings

* Close HTML tags in blocklist-related strings

* Remove trailing space from a translatable string in Qt client

* Add missing plural forms for English strings in Qt client

* Fix spelling: metaInfo -> metainfo
2022-10-11 18:39:41 +03:00
depler e3b871216f
Add missing include in port-forwarding-upnp.cc (#3911)
Got error `FMT_STRING: identifier not found` due lack of include
2022-10-08 22:27:06 +03:00
Charles Kerr 8ac2c0a814
fix: dht bootstrap regression (#3874)
Fixes #3868
2022-10-06 18:43:18 -05:00
Charles Kerr 89d6533cd7
build: support semver versioning (#3867)
* build: semver versioning

Xref: https://github.com/transmission/transmission/issues/1037

* test: add base62 tests for client-id

* build: include PATCH_VERSION in Transmission.rc.in

* build: semver versioning in version.h

* fixup! build: semver versioning in version.h

undo experimental verison changes that were made for testing purposes

* Fixup version in MSI package filename

Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-10-05 16:53:10 -05:00
Charles Kerr fff4c87740
refactor: add tr_address::toSockaddr() (#3870) 2022-10-04 14:52:51 -05:00
Charles Kerr b49129dfa6
fixup: new dht bootstrap regression (#3866) 2022-10-02 20:32:14 -05:00
Charles Kerr fed6d180fe
fixup: new coverity warnings (#3864)
* fixup: memcmp length argument regression

* perf: fix big parameter passed by value

* chore: silence unchecked curl_easy_setopt return value warning
2022-10-02 19:45:38 -05:00
Charles Kerr 3bb8f3c03f
fixup: new clang-tidy warnings (#3863) 2022-10-02 17:56:58 -05:00
Charles Kerr 0a0c15d17c
fix: circular dependency in udp core and dht init (#3862) 2022-10-02 13:18:23 -05:00
Charles Kerr 257d98545b
refactor: add tr_port_forwarding::Mediator (#3855)
* 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
2022-10-01 09:12:49 -05:00
Harm133 467be24358
Blocklist/Session: move loadBlocklists function to BlockListfile struct (#3854) 2022-09-30 18:29:26 -05:00
Harm133 1cd6c0464c
feat: Add IPv6 blocklist support (#3835) 2022-09-30 12:11:52 -05:00
A Cœur f27e1b52f4
Fix TR_ASSERT equality (#3852)
* Fix TR_ASSERT equality

* Further workaround to the assertions from tr-dht

* Update libtransmission/tr-dht.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-09-30 10:04:46 -05:00
Charles Kerr bf156a97cf
refactor: port forwarding (#3850)
* refactor: rename state enum type as tr_port_forwarding_state

* chore: use snake_case for tr_shared struct fields

* refactor: replace tr_shared with tr_port_forwarding

* refactor: make tr_natpmp_state an enum class

* refactor: uniform naming for port-forwarding module

* refactor: move output-only parameters in tr_natpmp::pulse() to return struct

* fix: use a nullptr multicastif if bindaddr is empty

* chore: use PascalCase for enum class values

* chore: clean up port-forwarding #includes

* chore: remove unused tr_port_forwarding::peerPort()
2022-09-30 08:59:10 -05:00
Charles Kerr a5ca289f41
fix: #3847 crash on session close (#3849)
* chore: use typesafe sin_addr assignment instead of memcpy()

* refactor: make tr_dhtPrintableStatus private

* refactor: make tr_dhtStatus() private

* refactor: make tr_dht status enum private

* refactor: add safety mutex wrapper around libdht API calls

* refactor: make tr_dht::Status an enum class

* refactor: rename private functions

* refactor: const correctness

* refactor: use typesafe assignment instead of memcpy

* refactor: tr_session does not directly call tr_dht

* refactor: tr_dhtPort() returns std::optional

* refactor: use tr_address::fromCompact4 in tr-dht.cc
2022-09-29 09:12:33 -05:00
Charles Kerr d82090658f
refactor: remove TR_PRIsv macros (#3842)
* refactor: remove TR_PRIsv from transmission-show

* refactor: remove TR_PRIsv from transmission-edit

* refactor: remove TR_PRIsv from transmission-remote

* refactor: remove TR_PRIsv from log.cc

* refactor: remove TR_PRIsv macro

* chore: remove FMT_STRING macro in transmission-edit

* refactor: use __android_log_write()
2022-09-23 14:36:37 -05:00
Charles Kerr 326d9f3daf
refactor: cppcoreguidelines-avoid-goto (#3841)
* refactor: do not use goto in file-win32.cc

* refactor: do not use goto in subprocess-posix.cc

* refactor: do not use goto in peer-io.cc

* build: add cppcoreguidelines-avoid-goto to libtransmission/.clang-tidy
2022-09-23 08:39:13 -05:00
Charles Kerr 56e0a1bda8
chore: add cppcoreguidelines-pro-type-member-init to libtransmission/.clang-tidy (#3840) 2022-09-23 00:51:15 -05:00
L2501 4977c1a02f
add clientIDs for BitTorrent Web, Free Download Manager 6, Torch Browser (#3838) 2022-09-22 16:55:51 -05:00
Charles Kerr 228efa16e3
refactor: tr_globalIPv6() returns a std::optional<in6_addr> (#3836) 2022-09-21 23:59:31 -05:00
Charles Kerr dd12fd010a
chore: iwyu headers (#3833) 2022-09-21 18:34:18 -05:00
Dmitry Antipov 243ab1058d
refactor: fold session UDP innards into C++ class (#3794)
* Use std::unique_ptr to manage UDP core object

N.B.: it's no longer valid to call socket adjustments quirks from
tr_sessionSetUTPEnabled() because the corresponding object may be
not created yet. We have to create (or re-create) it explicitly
(like it's done in tr_sessionSetDHTEnabled()) or just set
is_utp_enabled_ flag of the session and assume that socket
adjustments will be done later when the object is constructed.
2022-09-21 13:25:53 -05:00
Charles Kerr 80d9d5a63b
refactor: add tr_peerIo::peek() (#3798) 2022-09-09 13:12:47 -05:00
Charles Kerr c0f29a89ea
refactor: add [[nodiscard]] (#3793) 2022-09-08 21:49:51 -05:00
Charles Kerr 9280bf3475
chore: re-enable qt clang tidy warnings (#3791) 2022-09-08 18:26:18 -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
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
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 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
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
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
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
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