Commit Graph

14421 Commits

Author SHA1 Message Date
Charles Kerr 68bec3f8e3
refactor: remove tr_snprintf() (#2872) 2022-04-04 13:36:48 -05:00
Pierre Carru 32cff69213
torrent-daemon: watchdir can use .magnet files (#1328) 2022-04-03 21:14:44 -05:00
Mitch Livingston d948e49da7
Merge pull request #2870 from nevack/nevack/mojave-infowindow-fix
[macOS] Fix Tab selection in InfoWindow on Mojave
2022-04-03 14:40:59 -04:00
Charles Kerr 7aeb5d8b2f
Merge branch 'main' into nevack/mojave-infowindow-fix 2022-04-03 13:34:31 -05:00
Charles Kerr 1d7d17396f
refactor: remove tr_snprintf() pt 2 (#2871) 2022-04-03 13:23:00 -05:00
Dzmitry Neviadomski 7cf920a020 [macOS] Fix Tab selection in InfoWindow on Mojave
Fixes #2599
2022-04-03 16:41:09 +03:00
Gary Elshaw 57b03114dc
New images for 'Message Log' (#2779) 2022-04-02 20:08:39 -05:00
Charles Kerr 76f44b4b6f
fix: sonarcloud (#2868)
* refactor: make this variable const

* refactor: replace redundant type with auto

* refactor: use the nullptr literal

* refactor: replace declaration by structured binding declaration
2022-04-02 17:42:51 -05:00
Antoine Cœur 748d3c2223
updating googletest (#2858) 2022-04-02 15:58:59 -05:00
Charles Kerr 392e511f7e
refactor: remove tr_snprintf() pt 1 (#2867)
* refactor use fmt instead of tr_snprintf in remote.cc

* refactor use fmt instead of tr_snprintf in daemon.cc

* refactor use fmt instead of tr_snprintf in cli.cc
2022-04-02 14:34:29 -05:00
Charles Kerr 1cc9da26ba
fix: sonarcloud (#2865)
* refactor: implement FileTreeItem::children_ with a std::vector

* fix: std::move should not be called on forwarding reference

* fix: uninitialized scalar variable

* fix: unchecked return value from library

* fix: dereference before null check

* fix: unchecked return value from library

* fix: unchecked return value from library

* fixup! refactor: implement FileTreeItem::children_ with a std::vector

* fix: signed-unsigned comparison in libtransmission tests

* fix: avoid unnecessary copy by using const reference

* fix: function should be declared const

* refactor: use fmt::format to build log timestamps

* fix: use init-statement to reduce variable scope

* fixup! refactor: use fmt::format to build log timestamps

* fix: remove tau_tracker destructor for rule-of-zero

* fix: remove tr_peerIo destructor for rule-of-zero

* Revert "fix: dereference before null check"

This reverts commit cd78967815.

* fix: signed-unsigned comparison in libtransmission tests

* fix: use init-statement to reduce variable scope

* fix: extract nested code block into separate method

* fix: extract nested code block into separate method

* fix: extract nested code block into separate method

* fix: use init-statement to reduce variable scope

* fix: extract nested code block into separate method

* fix: signed-unsigned comparison in libtransmission tests

* fixup! fix: extract nested code block into separate method

* fix: mark possibly-unused as [[maybe_unused]]

* fix: invalid stack memory reference in tr_found_file_t

* fix: signed-unsigned comparison in libtransmission tests
2022-04-02 09:06:02 -05:00
Charles Kerr 46cc95f72e
refactor: remove unused functions (#2863)
* refactor: annotate nodiscard, constexpr, noexcept methods

* refactor: remove unused tr_blocklistFileExists()

* refactor: remove unused tr_blocklistFileIsEnabled()

* refactor: remove unused tr_ctorGetContents

* refactor: remove unused tr_error_is_set()

* refactor: remove unused tr_handshakeGetAddr()

* refactor: remove unused tr_ctorSetLabels()

* refactor: remove unused tr_http_escape_sha1()

* refactor: remove unused tr_lpdEnabled()

* refactor: remove unused tr_ptrArrayPop()

* refactor: remove unused tr_torrentClearIdleLimitHitCallback()

* refactor: remove unused tr_torrentFindFromHash()

* refactor: remove unused tr_sha1_to_string()

* refactor: remove unused tr_torrents::get()

* refactor: remove unused tr_isEncryptionMode()

* refactor: remove unused tr_isPreallocationMode()

* refactor: remove unused tr_ptrArrayBack()

* refactor: remove unused tr_ptrArrayClear()

* refactor: remove unused tr_torrents::get()

* refactor: remove unused Session::torrentSet()

* refactor: remove unused peer_atom comparison operators

* refactor: remove unused peer_atom::compare()

* refactor: remove unused Qt variantInit(tr_variant*, unsigned)
2022-04-01 21:55:30 -05:00
Charles Kerr ca5799a4a8
refactor: annotate nodiscard, constexpr, noexcept methods (#2862) 2022-04-01 19:48:09 -05:00
Charles Kerr 33cbe33229
refactor: remove varargs from TR_ASSERT_MSG() (#2861) 2022-04-01 18:00:51 -05:00
SweetPPro bfd7797c5e
fix: magnet link metainfo corrupted on restart (#2790) 2022-04-01 15:28:55 -05:00
Charles Kerr a250690f30
fix: sonarcloud (#2860)
* fix: break will never be executed

* fix: rewrite rimraf() to be non-throwing

* fix: conditional operation returns same value whether condition is true or false

* fix: use std::array instead of a C-style array

* fix: remove redundant access specifier

* fix: replace switch with if for readability

* fix: convert integer literal to a bool literal

* fix: replace const std::string reference to std::string_view

* fix: remove redundant access specifier

* fix: replace const std::string reference to std::string_view

* fix: remove unused parameter

* fix: remove redundant access specifier

* fix: use std::array instead of C-style array

* fix: remove redundant access specifier

* fix: replace const std::string reference with std::string_view

* fix: remove redundant access specifier

* fix: use std::array instead of C-style array

* fix: remove redundant access specifier

* fix: replace const std::string reference to std::string_view

* fix: remove redundant access specifier

* fix: merge if statement with enclosing one

* chore: clang-format

* chore: clang-format

* Revert "fix: remove redundant access specifier"

This reverts commit 054e4e7eec.

* Revert "fix: remove redundant access specifier"

This reverts commit 2c92f227e8.

* Revert "fix: remove redundant access specifier"

This reverts commit a0710202a8.

* Revert "fix: remove redundant access specifier"

This reverts commit 54da1d9397.

* Revert "fix: remove redundant access specifier"

This reverts commit f7b1777578.

* Revert "fix: remove redundant access specifier"

This reverts commit ad8e3dfff4.

* chore: revert access specifier change
2022-04-01 14:16:33 -05:00
Charles Kerr 6da591fe57
fixup! refactor: use fmt to build the GTK client's user-visible strings (#2788) (#2859)
fix: formattted speeds and percentages
2022-04-01 11:29:05 -05:00
Charles Kerr 1f15933fda
fix: incorrect magnet size calcuation in tr_completion (#2856) 2022-04-01 08:49:54 -05:00
Charles Kerr e64430941f
refactor: remove tr_strdup_printf() (#2854) 2022-03-31 19:13:37 -05:00
beizmos 995012aaa9
updated docs/Port-Forwarding-Guide.md (#2847)
* Add files via upload

- added guide for Windows
- cleaned up

* Update Port-Forwarding-Guide.md

minor fixes

* Updated Port-Forwarding-Guide.md

added note port router port mapping

* Update Port-Forwarding-Guide.md

added note about opening ports in windows

* Update Port-Forwarding-Guide.md

ip a command for unix

* Update Port-Forwarding-Guide.md

rewording, grammatical fixes, syntax
2022-03-31 15:53:21 -05:00
Charles Kerr 98e8d5a3da
fix: getBandwidthGroup use right group (#2853)
Fixes #2828.
2022-03-31 15:07:01 -05:00
Matan Ziv-Av 946cf04833
Bandwidth group are written to a dict, not to a list. (#2852)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-03-31 13:35:21 -05:00
Charles Kerr 6e91136b53
fix: three asan issues (#2851)
* fixup! feat: add support for adding torrents by raw hash values (#2608)

fix array-bounds-read issue found by asan

* fixup! refactor: tr_completion (#2220)

fix array-bounds-read issue in tests fixtures

* fixup! refactor: tr_torrents (#2722)

fix memory leak in torrent-tests
2022-03-31 12:12:54 -05:00
Mike Gelfand d943f069f5
Fix code_style.sh to include *.mm files after switch to Obj-C++ (#2846) 2022-03-31 00:52:23 +03:00
Charles Kerr e4461c48d7
refactor: prefer FMT_STRING (#2845)
* use FMT_STRING in libtr client on non-i18n strings

This gives compile-time safety checks.
2022-03-30 14:59:13 -05:00
Charles Kerr f4afb76695
perf: replace tr_torrentFindFile2() with tr_torrrent.findFile() (#2839) 2022-03-30 13:25:41 -05:00
Charles Kerr 4dd25d8112
fix: tr_strbuf move op loses zero-termination (#2843) 2022-03-30 12:10:51 -05:00
Charles Kerr 66638cc80c
test: fix race condition in move-test (#2841) 2022-03-30 01:30:39 -05:00
Charles Kerr 3dadeae700
fix: file progress in GTK Details dialog (#2838) 2022-03-29 20:52:24 -05:00
Charles Kerr f1a028bb84 chore: revert 2f677aebb assertion 2022-03-29 10:27:34 -05:00
Charles Kerr 4177e286a1
fix: sonarcloud (#2837)
* fix: rename variable to avoid shadow warning w/UTP

* fix: add default dtor for tr_strbuf

* fix: implicit conversion may lose precision

* fix: use init-statement to reduce variable scope

* fix: implicit conversion may lose precision

* fix: extract the assignment from this expression

* fix: use init-statement to reduce variable scope

* fix: use init-statement to reduce variable scope

* fix: do not mix public and private data members

* fix: add a condition to cv.wait call

* fix: do not throw uncaught exceptions in destructor
2022-03-29 05:57:04 -05:00
Charles Kerr 2f677aebb0
refactor: add tracer assertionf or bug #2727 (#2836) 2022-03-28 23:29:35 -05:00
Charles Kerr 2996e223dd
refactor: strbuf for metainfo files (#2833)
* refactor: tr_ctorSaveContents takes a string_view filename

* refactor: remove tr_ctorSaveMagnetContents

* refactor: announce_list::save takes a std::string_view

* refactor: magnet() takes an OutputIt arg

Generate the magnet link URL into an output iterator

* refactor: remove deprecated calls to tr_http_escape

* refactor: tr_torrent.torrentFile takes an OutputIterator

* refactor: tr_torrent.torrentFile returns a tr_pathbuf

* refactor: tr_torrent_metainfo.makeFilename returns a tr_pathbuf

* refactor: use tr_urlbuf in announcer-http
2022-03-28 17:13:32 -05:00
dependabot[bot] 3ddf76b560
build(deps): bump minimist from 1.2.5 to 1.2.6 in /web (#2831)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-03-28 08:10:46 -05:00
Matan Ziv-Av 25f2216dd4
Allow control of transmission-show output (#2825)
- Add flags to control each of the four sections of output (header, info, trackers, files).
- Add a flag to show file size in bytes, instead of human readable units (KiB, MiB, GiB, TiB).
2022-03-27 23:43:28 -05:00
Charles Kerr 9d141ee2b1
refactor: add fmt::formatters (#2829)
* refactor: add fmt::formatters
2022-03-27 21:55:30 -05:00
Charles Kerr 71ad42b1ef
refactor: make err arg optional in tr_sys_* funcs (#2827) 2022-03-27 12:37:29 -05:00
Mike Gelfand 3cd11ee1fb
Fix USE_QT_VERSION CMake option 2022-03-27 03:45:10 +01:00
Mike Gelfand c2549c3c77
Remove CPack symlinks workaround
Looks like it was a CMake defect.
2022-03-27 00:05:55 +00:00
Charles Kerr 4c2cb23c24
refactor: tr_variantToFile() takes a string_view filename (#2824)
* chore: fix shadowed variable warning

"byte" is declared by a third-party UTP header

* refactor: tr_variantFromFile, tr_variantToFile take a string_view filename
2022-03-25 22:39:08 -05:00
Matan Ziv-Av 45422a2ac5
Add support for group-get RPC call to transmission-remote (#2818)
Option `-lg` lists all bandwidth groups with their bandwidth limits.
2022-03-25 20:31:59 -05:00
Charles Kerr 977b2a1bab
refactor: tr_loadFile() tr_saveFile() take a std::string_view filename arg (#2822)
* refactor: tr_saveFile takes a string_view

* refactor: tr_saveFile, tr_loadFile take string_view filename
2022-03-25 19:31:27 -05:00
Charles Kerr 1051160b99
feat: strbuf features (#2821)
* feat: strbuf is always zero-terminated

* feat: tr_strbuf::append() now takes any number of args

* feat: tr_strbuf handles zero-terminated string inputs

* feat: add tr_strbuf::ends_with()

* feat: add tr_strbuf::starts_with()

* refactor: replace buildPath() with join()
2022-03-25 16:16:26 -05:00
Charles Kerr 9451446e6d
fix: set the destructor log level to trace (#2820)
Fixes #2816.
2022-03-25 14:14:27 -05:00
Charles Kerr 7905244320
fix: missing fmt::arg calls in GTK client (#2819) 2022-03-25 12:16:29 -05:00
Charles Kerr b94c6796c8
fix: sonarcloud warnings (#2815)
* fix: add default case to switch statement

* fix: remove redundant static specifier

* fix: use std::optional.value_or

* fix: make type of variable pointer-to-const

* refactor: move log state into a struct

* refactor: make tr_peerMgr constructor explicit

* fix: make type of variable pointer-to-const

* fix: replace insert with try_emplace

* fix: implicit conversion may lose precision

* fix: use init-statement to reduce variable scope

* chore: mark unused return value with (void)
2022-03-25 00:24:04 -05:00
Ali 0a8cfba3b3
Add ability to change piece size during torrent creation in MacOS GUI… (#2805)
* Add ability to change piece size during torrent creation in MacOS GUI (#2416)

* Shouldn't have committed the xcodeproj file
2022-03-24 22:26:21 -05:00
JP-Ellis cf6f279830
Fix finding system PSL library (#2812)
Whilst the library file my be called `libpsl`, CMake expects there to be a `lib` in front and thus the existing code was actually looking for `liblibpsl`.

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-03-24 21:14:11 -05:00
Charles Kerr bd895b5052
test: fix file-info test edge case (#2811) 2022-03-24 19:03:15 -05:00
Charles Kerr 6e8f9f3ff0
feat: add tr_strbuf (#2810)
* feat: add tr_strbuf class for building tmp strings

Based on fmt::basic_memory_buf, this is a growable string buffer that
has an initial size that's large enough to build most filenames or URLs
without needing heap allocations.

Adds a couple of extra helpers such as a `c_str()` method to make dealing
with old zero-terminated string APIs easier.
2022-03-24 16:41:29 -05:00