* perf: make pref_is_savable() constexpr
* refactor: use std::vector in tr_torrents::removedSince()
* chore: remove unused typedef in OptionsDialog
* perf: use std::vector in tr_num_parse_range()
* perf: use small::max_size_set in FileTreeItem::update()
* perf: use small:set in Wishlist::next()
* perf: use small:map in FilterBar
* perf: use small::map for counts in tr_logAddMessage()
* perf: use small::max_size_map in FileTreeModel::twiddleWanted()
perf: use small::max_size_map in FileTreeModel::twiddlePriority()
* perf: use a std::array instead of std::map in TorrentFilter::update()
* perf: use a std::array instead of std::map in TorrentSorter::set_mode()
* perf: use a std::array instead of std::map in TorrentSorter::update()
* perf: use small::set in Application::Impl::on_rpc_changed_idle()
* perf: use std::array for MessageLogColumnsModel::level_names_
* fixup! perf: use std::array for MessageLogColumnsModel::level_names_
* fixup! perf: use small::map for counts in tr_logAddMessage()
* fix: specify `port-test` ip protocol in response when possible
* feat: IPv4 and IPv6 port test in Qt Client
* feat: shorten timeout of `port-test`
* feat: IPv4 and IPv6 port test in Gtk Client
* chore: housekeeping
* refactor: remove IP protocol error message
* code review: mikedld gtk
* feat: return tag in qt rpc response
* code review: mikedld qt
* feat: move port test button up alongside spin button
* fixup! code review: mikedld gtk
* fixup! code review: mikedld qt
* code review: port status initial text
* feat: decouple ipv4 and ipv6 status updates (GTK)
* feat: decouple ipv4 and ipv6 status updates (Qt)
* code review: unknown protocols are non-pending
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
* code review: simplify status text when the statuses are the same
* Revert "feat: return tag in qt rpc response"
This reverts commit 2a022c2bb0ee7ddad81f8176839cf0d043422368.
* code review: add translation context for status text (GTK)
* code review: move `port_test_pending_` to `Impl` (GTK)
* fixup! code review: move `port_test_pending_` to `Impl` (GTK)
---------
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
* chore: drop redundant if branch
* chore: housekeeping
* refactor: always keep error message as the second
* fix: restore `files-wanted` argument of `torrent-set`
* android patches for ndk
* Update libtransmission/file-capacity.cc
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
* TrMacros: Move common & android vars
* Build android in CI
* Use vcpkg packages for curl & openssl
* Update CI for android
* Fix ndkVersion used with gradle
* Restore actions triggers events
* CMakeLists: Remove cond where curl is not found
* Use vcpkg tag instead of commit hash
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
* TrMacros.cmake: clean unused variables & add vcpkg cond
* Remove quotes around VcpkgAndroid inclusion
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
* actions: split steps to install vcpkg packages
* Build for android arm64
* actions: add make-android condition
* Revert "Use vcpkg tag instead of commit hash"
This reverts commit 65819026b1.
* build.gradle: use cmake version 3.22.1
* actions: use vcpkg 2024.01.12
* actions: Add ninja-build dependency
---------
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
* refactor: tr_rpc_request_exec_json takes a std::function callback
* refactor: tr_rpc_request_exec_json callback takes a tr_variant&&
* refactor: use new tr_variant API in rpcimpl.cc
* refactor: tr_rpc_request_exec_json() now takes a const& to the request
* fixup! refactor: use new tr_variant API in rpcimpl.cc
* chore: rename function to tr_rpc_request_exec()
* chore: remove unused DetailsDialog::Impl::build_torrent_ids_variant_list()
* refactor: minor copyediting in rpcimpl.cc getTorrents()
* refactor: split handler methods between sync, async
* refactor: remove unused args_out param from AsyncHandlers
* chore: fix new readability-inconsistent-declaration-parameter-name warning
* refactor: unset peer BEP-9 support if size hint is invalid
* fix: open torrent file in binary mode
* refactor: move metadata size check to method
* refactor: remove duplicate checks
* refactor: reduce temp variable scope in `parseLtepHandshake()`
* refactor: convert `get_piece_length()` to method
* refactor: convert `tr_torrentSetMetadataSizeHint()` to method
* refactor: convert `tr_torrentGetMetadataPiece()` to method
* refactor: convert `tr_torrentUseMetainfoFromFile()` to method
* refactor: convert `tr_torrentSetMetadataPiece()` to method
* refactor: convert `tr_torrentGetNextMetadataRequest()` to method
* refactor: convert `tr_torrentGetMetadataPercent()` to method
* refactor: add basic framework for MagnetMediator
* refactor: initialise `tr_incomplete_metadata` fields in constructor
* refactor: check metadata transfer completion in `set_metadata_piece()`
* refactor: convert `use_new_metainfo()` and `on_have_all_metainfo()` to methods
* refactor: move parts of `tr_torrent::set_metadata_piece()` into `tr_incomplete_metadata`
* refactor: move parts of `tr_torrent::get_next_metadata_request()` into `tr_incomplete_metadata`
* refactor: move parts of `tr_torrent::get_metadata_percent()` into `tr_incomplete_metadata`
* refactor: hide all `tr_incomplete_metadata` fields
* refactor: move `incomplete_metadata` to private
* feat: add test for `set_metadata_piece()`
* refactor: unify integer types
* refactor: rename `tr_incomplete_metadata` to `tr_metadata_download`
* chore: make clang-tidy happy
libtransmission/torrent-magnet.cc:117:68: warning: comparison of integers of different signs: 'long' and 'const uint64_t' (aka 'const unsigned long') [clang-diagnostic-sign-compare]
* refactor: pass log name to `tr_metadata_download` constructor
* chore: iwyu
* fix: thread-safe `TorrentMagnetTest.setMetadataPiece`
* chore: housekeeping
* Revert "fix: thread-safe `TorrentMagnetTest.setMetadataPiece`"
This reverts commit 2a7fcd93a262888f9f55d542b1a9a2da9ca72cea.
* fix: stop soon instead of stop now in `on_metainfo_completed()`
This is unreachable code now, but if it is ever reached, Transmission
will very likely crash.
* fix: maybe fix OpenBSD test failure
* fix: return read buffer size in libutp read buffer size callback
* refactor: clamp amount of data processed in `can_read_wrapper()`
* chore: housekeeping
* refactor: call `utp_read_drained()` in on-read callback
so that uTP acks can be sent out in a more timely fashion
* refactor: do not use tr_strlcpy() in tr_strratio()
* refactor: do not use tr_strlcpy() in bindUnixSocket()
* refactor: do not use tr_strlcpy() in trackerView()
* chore: remove tr_strlcpy() unit tests
* chore: remove tr_strlcpy()
* chore: remove -DHAVE_STRLCPY from Xcode build
* fixup! refactor: do not use tr_strlcpy() in trackerView()
chore: fix copypaste bug
* refactor: do not u se tr_str_is_empty() in tr_torrentSetLocation()
* refactor: do not use tr_str_is_empty() in remote.cc
* refactor: do not use tr_str_is_empty() in subprocess-win32
* refactor: remove tr_str_is_empty()
* fix: don't check `total_size` against `metadata_size_hint`
* refactor: remove `metadata_size_hint`
* refactor: restart metadata transfer from scratch on failing
* refactor: make tr_block_info::init_sizes() private
* refactor: remove unuse tr_file_piece_map::empty()
* refactor: remove tr_file_priorities::reset()
* refactor: remove tr_files_wanted::reset()
* refactor: rename method to tr_file_piece_map::piece_span_for_file()
more consistent naming with tr_block_info
* refactor: rename method to tr_file_piece_map::file_span_for_piece()
more consistent naming with tr_block_info
* refactor: use standard class field order in tr_block_info
* refactor: move CompareToSpan from header to cc file
* refactor: make tr_file_piece_map::reset() private
* refactor: rename method to tr_file_piece_map::file_count()
* refactor: rename method to tr_file_piece_map::byte_span_for_file()
* refactor: constify tr_block_info function args
* refactor: fix more signed vs unsigned
* refactor: move tr_preallocation_mode info tr_open_files
* refactor: remove unnecessary error nullptr check
* refactor: use snake_case for private method names in inout.cc
* refactor: extract-method get_fd() from read_or_write_bytes()
* refactor: make function args const where possible
* refactor: simplify read_or_write_bytes()
* refactor: make buflen a uint64_t in read_or_write_piece()
* refactor: move tr_torrentStop() logic from read_or_write_piece() to tr_ioWrite()
* refactor: make tr_ioFoo() functions take a const torrent
* refactor: make tr_cache::close_torrent_files() take a tor_id instead of a torrent
* perf: parse the .resume file contents inplace
* perf: use unmanaged strings in make_torrent_field()
* perf: accept moved strings in tr_error::set()
* perf: use small::vector in tr_peerMsgsImpl::sendPex()
the expected pex size is predictable and fits easily on the stack
* refactor: initialize libtransmission::Values units in Application::initUnits()
* refactor: use libtransmission::Values instead of Formatter::unitStr()
* refactor: remove Formatter::Size, Formatter:Type
* refactor: use Values::Config to init units in transmission-qt
* refactor: use Values::Config to init units in transmission-mac
* chore: remove unused tr_formatter_foo_init() functions
* chore: make Value::operator+() const
* use Values::Speed, Values::Storage in GTK client
* chore: use snake_case for Formatter methods
* refactor: use Values::Speed in GTK client details dialog
* feat: add Values::Value::is_zero()
* refactor: remove unnecessary UTF8String calls
* refactor: remove the tr_error** idiom
* fix: tr_error::message() is only constexpr in c++20 and up
* chore: silence a couple of g++-12 Wshadow warnings
When getting all torrents in a batch over RPC, the results are sorted by
info-dict hash. Prior to 4.0.0, they were sorted by ID. This change broke
some peoples' workflows.
I'm OK with breaking workflows if it's necessary to improve the program,
but this was an unintentional side-effect and I don't see any inherent
benefit to either sort order. So this PR restores the 3.00 sort order.
https://xkcd.com/1172/
* refactor: directly copy from socket to incoming payload
* refactor: directly process the incoming field
There is no need to copy the payload to a new buffer before processing.
`process_peer_message()` isn't going to return until it's done, and nothing else is going to mess with the incoming field while inside `process_peer_message()`.
* refactor: remove while loop
* add assert
* refactor: use std::set instead of QSet in WatchDir.cc
* refactor: use std::set instead of QSet in FileTreeView.cc
* refactor: use std::set instead of QSet in ColumnResizer.cc
* refactor: use std::set instead of QSet in Prefs.cc
* chore: fix rebase error that changed libsmall snapshot
* refactor: more replace QSet with std::set
* refactor: minor decoupling in peer-mgr
Pass a tr_torrents& and TimerMaker& into the tr_peerMgr and HandshakeMediator
constructors so they can be used directly instead of via tr_session.
No functional changes.
* refactor: in HandshakeMediator, make the session reference const
* feat: add `ipProtocol` argument to `port-test` rpc method
* chore: update rpc-spec.md
* feat: split port check UI to IPv4 and IPv6 in webUI
* fix: default `open` to false if cannot get response
* chore: minor docs wording tweak
* chore: make clang-tidy happy
* chore: RPC doc tweaks
* fix: bad merge
* chore: review feedback
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* chore: match quark enum with parameter case
* refactor: use descriptive strings for `ipProtocol`
* chore: update docs
* fixup! refactor: use descriptive strings for `ipProtocol`
* fixup! chore: update docs
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* feat: escape json string according to RFC8259
* fix: do not append newline when json serde is in compact mode
* fix: json tests
1. Use the same locale settings as the apps
2. Added additional test case for a string that are known to be prone to locale issues
3. Removed test for escaping non-BMP characters to UTF-16 escape sequences
* chore: add more test cases to `JSONTest.testUtf8`
* chore: order cases in the same order as RFC8259