Commit Graph

13788 Commits

Author SHA1 Message Date
Charles Kerr 9200d972c3
refactor: use a std::vector for tr_session.removed_torrents (#2062) 2021-10-29 18:49:15 -05:00
Charles Kerr f270d6081c
refactor: cppcoreguidelines-init-variables pt. 15 (#2055)
* refactor: uninit vars in subprocess-posix

* refactor: uninit vars in handshake

* refactor: uninit vars in file-posix

* refactor: uninit vars in platform-quota
2021-10-29 17:43:25 -05:00
Charles Kerr d6032f829b
refactor: remove tr_piece struct (#2059)
* refactor: remove tr_piece struct
2021-10-29 13:24:30 -05:00
Frank Aurich 82d9232084
Fix RPC 'table' mode not being properly activated (#2058)
* Fix RPC 'table' mode not being properly activated.
2021-10-29 01:54:46 -05:00
Mike Gelfand 5da0a5d59b
Fix off-by-one mistake in `gtr_str_strip()` (#2057)
Was always trimming last non-whitespace char from the input text.

Fixes: #2027
2021-10-28 23:52:25 +03:00
Charles Kerr 1d0993c3a5 fix: fmr warning in removeAllPeers() 2021-10-27 21:43:12 -05:00
Charles Kerr 9be93a489e
refactor: simplify sorting peers by liveliness (#2050) 2021-10-27 21:05:00 -05:00
Charles Kerr 6bd229fcfd
fix: clang 13 nullptr warnings in libtransmission (#2054)
* fix: nullptr dereference warning in tr_peerMgrPeerStats

* fix: nullptr dereference warning in refillUpkeep()

* fix: nullptr dereference warning in tr_peerIsSeed()

* fix: nullptr dereference warning in rechokeUploads()

* fix: nullptr dereference warning in tr_variantDictAdd

* fix: nullptr dereference warning in tr_ioFindFileLocation()

* fix: nullptr dereference warning in tr_spawn_async_in_child()

* fix: nullptr dereference warning in calculatePiecePriority()
2021-10-27 20:16:24 -05:00
razaq c3f1aafb96
add TR_TORRENT_TRACKERS env variable to script call (#2053)
* add TR_TORRENT_TRACKERS env variable to script call
2021-10-27 13:25:09 -05:00
Charles Kerr ed801eab8f
feat: less prolix announce error logging (#2052) 2021-10-27 08:34:16 -05:00
Dan Walters 8234d064a8
fix: apply optional peer socket TOS to UDP sockets (#1043)
This effectively makes the TOS setting apply to uTP and DHT traffic.

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-10-26 20:59:31 -05:00
Charles Kerr 2b65b985cf
refactor: cppcoreguidelines-init-variables pt. 14 (#2049)
* refactor: fix uninit var warnings in ptrarray

* refactor: fix uninit var warnings in bitfield

* refactor: fix uninit var warnings in handshake

* refactor: fix uninit var warnings in tr-dht

* refactor: fix uninit var warnings in natpmp

* refactor: fix uninit var warnings in tr-dht

* refactor: fix uninit var warnings in crypto-utils-openssl

* refactor: fix uninit var warnings in handshake

* refactor: fix uninit var warnings in crypto-utils

* refactor: fix uninit var warnings in crypto

* Revert "refactor: fix uninit var warnings in handshake"

This reverts commit 5aaa9cc30a.

* refactor: fix uninit var warnings in crypto-utils-ccrypto

* refactor: fix uninit var warnings in crypto-utils-polarssl

* refactor: fix uninit var warnings in crypto-utils-cyassl

* fixup! refactor: fix uninit var warnings in crypto-utils-cyassl

* fixup! refactor: cppcoreguidelines-init-variables pt. 13 (#2043)
2021-10-26 19:16:56 -05:00
Frank Aurich d9277d4b93
transmission-remote: Fix size display for torrents > 4GB (#2029)
* As size_t is not 64-bit on all platforms, explicitly use uin64_t when dealing with byte sizes to support torrents > 4GB
2021-10-26 16:06:47 -05:00
Frank Aurich c369f23686
Make sure LargeFileSupport flags are set correctly after repeated calls to cmake/ccmake/cmake-gui (#2039)
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-10-26 14:14:35 -05:00
Charles Kerr b797b4c94f
refactor: cppcoreguidelines-init-variables pt. 13 (#2043)
* refactor: fix uninit var warnings in ptrarray

* refactor: fix uninit var warnings in bitfield

* refactor: fix uninit var warnings in handshake

* refactor: fix uninit var warnings in tr-dht

* refactor: fix uninit var warnings in natpmp

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2021-10-26 13:02:07 -05:00
Frank Aurich c42e05b42f
Fix: When removing one or more selected torrents without deleting their data, make sure to only send torrentIds, not full torrent objects, via RPC (#2040)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2021-10-25 17:24:20 -05:00
Charles Kerr a1c5a215bf
refactor: remove peer-mgr replication info (#2021)
* refactor: remove peer-mgr replication info

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2021-10-25 10:29:19 -05:00
Mike Gelfand 81147a8fbb
CMake fixes for universal builds on Mac (#2044)
* Use CMake to build libevent on all platforms

* Pass Mac-specific flags down to 3rd-party projects
2021-10-25 11:14:04 +03:00
Charles Kerr 775e30eefd
refactor: getPeerCandidates returns a std::vector (#2042)
Previously was a manually-malloced and freed array.
2021-10-25 00:15:04 -05:00
Charles Kerr 93d8a03d55
refactor: remove outvar args from tr_torGetFooBlockRange() functions (#2041) 2021-10-24 22:39:19 -05:00
Charles Kerr 4a1ce7d645
fixup! Add a "Start Now" action to the notification window in the Qt client (#848) (#2026)
refactor: avoid "declaration requires an exit-time destructor" warnings
2021-10-24 18:52:50 -05:00
Dzmitry Neviadomski 3a966a77d1
Remove C-style STD headers in watchdir-kqueue.cc (#2037)
`string.h` is unused, `cerrno` is needed for `errno` macro.
2021-10-24 17:30:31 -05:00
Dzmitry Neviadomski 9bb3de406b
Fix CMake and Ninja rebuilds on macOS. (#2036)
The problem could occur with Makefiles also.
Use `-r` option on `rm` as `*.iconset` is a directory.

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-10-24 16:48:20 -05:00
Charles Kerr 3008a992ca
fix: Bitfield.getRaw() regression (#2023)
* fix: Bitfield.getRaw() regression
2021-10-24 15:43:36 -05:00
C.W. Betts 62c92227e3
macOS: use SDK's libCurl. (#1542)
* Use the SDK's provided libcurl instead of relying on an outdated stub library.

* Quiet a linker warning.

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2021-10-24 22:27:23 +03:00
Mike Gelfand 5edbcb3740
Add CommonCrypto-based crypto utils implementation (#2032)
* Add CommonCrypto-based crypto utils implementation

Ported and adapted from an old (circa 2014-2015) branch of mine.

DH helpers are based on CCBigNum since CCDH doesn't provide acceptable error
reporting, and SecDH interface is a bit weird and limiting. Given that all
mentioned APIs are private, it doesn't seem to matter which one we're using as
any of them could be changed/removed by Apple at any point.

* Switch Xcode project to CommonCrypto backend
2021-10-24 21:19:57 +03:00
Charles Kerr 3ec312dee8
refactor: cppcoreguidelines-init-variables pt. 12 (#2022)
* refactor: cppcoreguidelines-init-variables pt. 12 (#2022)
2021-10-24 12:40:15 -05:00
Charles Kerr c472cbd88d
refactor: only use [[maybe_unused]] if arg might be used (#2033)
* refactor: [[maybe_unused]] iff arg _might_ be used

If the arg is never used, comment out its name.
If the arg is _sometimes_ used e.g. with ifdefs, use [[maybe_unused]].
2021-10-24 11:41:54 -05:00
Charles Kerr 16acdf5934
chore: silence minor GTK warnings (#2034)
* chore: fix clang-diagnostic-suggest-destructor-override in makemeta-ui

* chore: fix Wunused-private-field in tr-prefs

* chore: fix clang-diagnostic-c++98-compat-extra-semi in tr-core.cc

* chore: fix clang-analyzer-deadcode.DeadStores in tr-core.cc

* chore: fix clang-diagnostic-exit-time-destructors for Glib::Quarks in details.cc
2021-10-24 10:55:51 -05:00
Mike Gelfand 8c40fd8b39 Fix testing against reference crypto impl 2021-10-24 13:39:03 +03:00
Charles Kerr 1413346fa2
fix: details dialog "available" percent can be off (#2025)
It's often off by a little bit because it fails to account for blocks
we've downloaded but haven't been verified yet. Copied the fix from the
GTK client.
2021-10-23 23:45:10 -05:00
Charles Kerr d70c8387b3
fixup! refactor: use qt5's connect api (#1491) (#2024)
* fixup! refactor: use qt5's connect api (#1491)

fix broken signal connection in session dialog
2021-10-23 22:28:16 -05:00
Charles Kerr a127826d76
refactor: cppcoreguidelines-init-variables pt. 11 (#2012)
* refactor: uninit vars in bandwidth.cc

* refactor: uninit vars in cache.cc

* refactor: uninit vars in fdlimit.cc

* refactor: uninit vars in inout.cc

* refactor: uninit vars in platform.cc

* refactor: uninit vars in log.cc

* refactor: uninit vars in tr-utp.cc

* refactor: uninit vars in stats.cc

* refactor: uninit vars in trevent.cc

* refactor: uninit vars in session-id.cc

* fixup! refactor: uninit vars in cache.cc

* refactor: uninit vars in upnp.cc

* refactor: uninit vars in file.cc

* refactor: uninit vars in tr-lpd.cc

* refactor: uninit vars in tr-udp.cc
2021-10-23 10:43:15 -05:00
Daniel Kamil Kozar 4996f3356a
Add a "Start Now" action to the notification window in the Qt client (#848)
* Add a "Start Now" action to the notification window in the Qt client

Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2021-10-23 09:26:28 -05:00
Oleg Chashko 54b85583e6
Fixes #1904 (#2019)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-10-22 19:16:08 -05:00
Charles Kerr b9e8a11793
fixup! refactor: use std::string in tr_scrape_response (#1866) (#2018)
fix leaked errmsg introduced in 3fd5c81 (#1866)
2021-10-22 18:14:46 -05:00
Charles Kerr 91a447e3ea
fixup! refactor: use std::string in tau_tracker (#1867) (#2017)
fix: memory leak regression
2021-10-22 17:01:55 -05:00
Charles Kerr 94ee81f98d
fixup! refactor: add tr_peer_id_t (#2004) (#2016)
fix: array bounds read error introduced yesterday
2021-10-22 15:24:30 -05:00
Oleg Chashko 0c39924074
Fixed: #1890 (#2013) 2021-10-22 11:58:53 -05:00
Charles Kerr 9e716bb9dc
refactor: cppcoreguidelines-init-variables pt. 10 (#2006)
* refactor: uninit vars in peer-io.cc

* refactor: uninit vars in rpc-server.cc

* refactor: uninit vars in port-forwarding.cc

* refactor: uninit vars in torrent-ctor.cc
2021-10-22 08:51:36 -05:00
Oleg Chashko af38bb1dc3
Fixed: In the "Filter Bar" the "Groups" icon is clipped at the top #1905 (#2005)
* Fix & Added for #443. Fixes: #1905
2021-10-22 07:46:54 -05:00
Oleg Chashko 3d5fb103d3
Fixed: #1902 (#2008)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-10-22 07:45:09 -05:00
Charles Kerr b491da0ce4
refactor: add tr_peer_id_t (#2004)
* refactor: move handshake_done args into a convenience struct

* refactor: move peer_id from peerIo to tr_handshake

tr_handshake is a short-term object and tr_peerIo is long-term, so this
effectively narrows the scope of this field.

* chore: remove unused field tr_peerIo.isEncrypted

* refactor: add tr_peer_id_t type to hold peer ids.

this is a 'using' alias to a std::array<> so that code passing peer-ids
around doesn't have to memcmp / memcpy PEER_ID_LEN anymore. Also removes
the now-unused PEER_ID_LEN macro.
2021-10-21 21:40:55 -05:00
Charles Kerr 3b019ada3d
refactor: remove redundant assertions (#2009) 2021-10-21 19:02:38 -05:00
Charles Kerr 8cdc2c633e
refactor: replace tr_torrentFiles() with tr_torrentFileProgress() (#1994)
* refactor: s/tr_torrentFiles/tr_torrentFileProgress

Replace tr_torrentFiles() with a new function, tr_torrentFileProgress().

tr_torrentFiles() heap-allocated an array of progress structs. There is
nothing intrinsic in tr_torrent making batch computation more efficient,
so this PR replaces it with tr_torrentFileProgress(), a per-file variant
that doesn't use the heap.
2021-10-21 13:31:03 -05:00
Charles Kerr b0fd4b474a
refactor: cppcoreguidelines-init-variables pt. 9 (#1997)
* refactor: fix uninit variable warnings in getopt, torrent-magnet
2021-10-21 12:40:36 -05:00
Charles Kerr 850b3caa61
refactor: prefer constexpr over enum for non enumerated constants (#1996)
refactor: prefer constexpr over enum for non-enumerated constants
2021-10-20 19:39:05 -05:00
Charles Kerr 241dc34019
fixup! refactor: tr_variant*Str() functions now take a std::string_view (#1990) (#1999) 2021-10-20 17:43:31 -05:00
Charles Kerr 32395056e2
refactor: cppcoreguidelines-init-variables pt. 8 (#1993)
* refactor: fix uninit var warnings in rpcimpl
2021-10-20 11:31:20 -05:00
Charles Kerr 236a0965fa
refactor: tr_variant*Str() functions now take a std::string_view (#1990)
* refactor tr_variant*Str functions now take a std::string_view

* refactor: tr_torrentPrimaryMimeType returns a string-view
2021-10-19 21:30:50 -05:00