* fix: mask non-UTF-8 characters in torrent file paths
BEP-3 requires strings to be UTF-8. Run path components through
tr_strv_to_utf8_string() to replace invalid bytes with U+FFFD
before sanitizing. Adds test with good and bad UTF-8 paths.
* replace ctrl characters in 'name' and 'path'
* Revert "replace ctrl characters in 'name' and 'path'"
This reverts commit 6816f59295.
* fix: mask non-UTF-8 characters in torrent file paths
BEP-3 requires strings to be UTF-8. Run path components through
tr_strv_to_utf8_string() to replace invalid bytes with U+FFFD
before sanitizing. Adds test with good and bad UTF-8 paths.
* replace ctrl characters in 'name' and 'path'
* Revert "replace ctrl characters in 'name' and 'path'"
This reverts commit 6816f59295.
* prepare for future Bittorrent v2 usage
* reject .torrent files with missing info:[pieces] key
* reduce test torrent size
* add more tests for bad 'pieces' key
* use files_.total_size()
* fixup code_style
* anonymize piece hashes
* move dupe files check to finishInfoDict()
* better piece count comparison
* add test for dupe files
* revert else if -> else
* update for #8409, move tests to torrents-metainfo suite
* add test for duplicate pieces key and tidy
* deeper testing of error conditions
Co-authored-by: Yat Ho <lagoho7@gmail.com>
---------
Co-authored-by: Yat Ho <lagoho7@gmail.com>
* chore: rename display-mode-tests.cc as converter-tests.cc
* feat: support std::chrono::sys_seconds in serializers
* feat: support std::u8string, std::filesystem::path in serializer
* build: address review feedback
* chore: remove unnecessary helper function
* Revert "chore: remove unnecessary helper function"
This reverts commit 69ea907836.
std::to_chars() unavailable on macOS < 13.3
We can remove this hack if/when we drop support for macOS < 13.3
* refactor: move primary_mime_type() to tr_torrent_files where it is easier to test
* fix: use video/mp4 mime type for .mp4 files
* docs: remove obsolete code comment
* refactor: add StatsMode to libtransmission-app
* test: add display-mode unit tests
* feat: add apicompat for StatsMode
* refactor: use StatsMode in Qt client
* refactor: add template method for gtr_set_pref()
* refactor: use StatsMode in GTK client
* ci: use the all-tests alias instead of hardcoding tests
* ci: copy runtime DLLS into test output directory for Windows test binaries
* fix: warning: declaration shadows a variable in the global namespace [clang-diagnostic-shadow]
* fix: warning: use 'contains' to check for membership [readability-container-contains]
* fix: warning: variable gl_confdir can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]
* warning: function 'TorrentFilter::match_mode' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]
* build: add sigslot dependency
* refactor: use sigslot for tr::Blocklists
* refactor: use sigslot for torrent, peer-mgr, wishlist
* refactor: remove tr::SimpleObservable
* chore: make lint happy
warning: method 'make_wishlist' can be made static [readability-convert-member-functions-to-static]
warning: invalid case style for function 'make_wishlist' [readability-identifier-naming]
warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays]
* refactor: remove unused forward declaration of tr_peer
* chore: remove slop
* refactor: Blocklist::observe_changes() now returns a scoped connection
* build: use transmission/sigslot fork
* refactor: copyediting
* refactor: fix cyclical dependency loop between Wishlist and tr_peerMgr::WishlistMediator
* Revert "fix: put torrent in "recently active" set after changing queue position (#8290)"
This reverts commit c4283e0c8f.
* fix: update changed dates after setting torrent queue position
* refactor: callers now own the return value of tr_torrentStat()
fix one potential thread issue by simplifying ownership
* refactor: make tr_stat_errtype an enum class; move into tr_stat
* refactor: order tr_stat fields to reduce padding
* chore: fix branch shear
* fix: int-to-enum-class comparison
* fix: namespace regression
* chore: make clang-tidy happy
* fix: some errors are not returned in `tr_sys_path_get_capacity()`
* test: disable well-formed free_space tests
There are no reliable way to test them.
* chore: remove unused tr_announcerCreate() declaration
added in d27c4c5 but never used
* chore: remove unused ParserStack::parentType()
added in 5efec26 but never used
* chore: remove tr_port::set_network()
added in 32f854a but never used
* chore: remove tr_torrent_metainfo::pieces_offset()
added in 52f6e80 but never used
* chore: remove unused `tr_session::setPeerCongestionAlgorithm()`
unused after 611d36a
chore: remove unused `tr_session::setAnnounceIP()`
unused after 611d36a
* refactor: tr_sys_file_open() now takes a std::string_view arg
* refactor: tr_sys_path_copy() now takes a std::string_view arg
* refactor: tr_blocklistSetContent() now takes a std::string_view arg
* refactor: tr_sys_path_remove() now takes a std::string_view arg
* refactor: tr_sys_path_exists() now takes a std::string_view arg
* refactor: tr_sys_dir_create() now takes a std::string_view arg
* refactor: add private stat_sv(), lstat_sv() helpers in file-posix.cc
* refactor: tr_sys_path_is_same() now takes a std::string_view arg
* refactor: tr_sys_path_rename() now takes a std::string_view arg
* refactor: tr_ctorGetDownloadDir() returns a std::optional<std::string>
* refactor: tr_sessionGetConfigDir() now returns a std::string
* refactor: tr_sessionGetDownloadDir() now returns a std::string
* refactor: tr_sessionGetIncompleteDir() now returns a std::string
* refactor: tr_sessionGetRPCWhitelist() now returns a std::string
* refactor: tr_sessionGetRPCPassword() now returns a std::string
* refactor: tr_sessionGetRPCUsername() now returns a std::string
* refactor: tr_sessionGetScript() now returns a std::string
* refactor: tr_blocklistGetURL() now returns a std::string
* refactor: tr_ctorGetSourceFile() now returns a std::optional<std::string>
* refactor: tr_torrentFile() now returns a std::string
* refactor: rename enum types in ip-cache private enum class is_updating_t
this avoids name collisions with YES and NO on macOS
* refactor: rename tr_strv_convert_utf8() to tr_strv_to_utf8_string()
use a name that is symmetrical with the upcoming tr_strv_to_utf8_nsstring()
* feat: add tr_strv_to_utf8_nsstring()
* test: add tests for the new tr_strv_to_utf8_nsstring() methods
* refactor do not cache style in convert_outgoing_data() -- not testing-friendly
* refactor: pass a QNetworkAccessManager into RpcClient constructor
this way we can inject a fake one in tests
* refactor: add RpcClient tests
* refactor: remove pointless QVERIFY call
* refactor: add api_compat::default_style()
* refactor: add api_compat::set_default_style()
* test: parameterize RpcClient tests for Tr4 and Tr5
* refactor: make libcurl thread shutdown faster during tests
* docs: fix out-of-date code comment in web.h
* refactor: tr_sessionClose() now takes fractions of seconds for deadline
refactor: make tr_web::startShutdown() deadline dependent on the tr_sessionClose() deadline arg
* test: set tr_sessionClose() deadline of 0.5 secs
* refactor: FileTest now inherits from SandboxedTest
* fixup! test: set tr_sessionClose() deadline of 0.5 secs
* Revert "build(cmake): support building with (almost) all system 3rd-party libraries (#7554)"
This reverts commit a89ca4f2c9.
* fixup! refactor: use a map of getters, setters for `session_get` and `session_set` properties (#8024)
fix: capture-by-reference error in session_accessors()
* fix: 'Qt depends on a UTF-8 locale' CI warning
* fix: 'qt.qpa.xcb: could not connect to display' CI error