Charles Kerr
da855a7257
refactor: use std mutex/lock intead of bespoke ( #2194 )
...
* refactor: use std mutex/lock intead of bespoke
2021-11-20 15:20:45 -06:00
Charles Kerr
ec457551ab
refactor: make Bandwidth.children a std::vector ( #2197 )
2021-11-20 10:58:47 -06:00
Charles Kerr
f7b729a350
refactor: add tr_buildTorrentFilename() ( #2196 )
...
a simpler API for building .torrent and .resume filenames
2021-11-19 18:36:25 -06:00
Charles Kerr
073c6af1d6
refactor: swarm ( #2103 )
...
* refactor: encapsulate request tracking in a class
Introduces a new class to peer-mgr, `ClientRequests`, which tracks what
active requests we've got pending: which blocks, when the requests were
sent, and who they were sent to.
This shouldn't change peer-mgr behavior. Its goal is to carve out some
of peer-mgr's data structures and encapsulte them behind an API that's
simpler to understand.
* refactor: move ActiveRequests to its own file
* perf: avoid duplicate call to tr_cpMissingBlocksInPiece
2021-11-19 12:37:38 -06:00
Charles Kerr
0b58e7afa7
fix: log the correct errno on libevent socket error
2021-11-18 16:07:00 -06:00
Charles Kerr
b3e4fc64c5
perf: faster shutdown ( #2193 )
...
* perf: don't update queue positions during shutdown
When a torrent is being removed, we try to update the queue positions of
the other torrents. But it's (slightly) expensive and is irrelevant when
the session is closing, so skip it in that case.
* perf: torrentLoadResume shouldn't touch tor->dirty
Loading torrent settings from disk does call a lot of tr_torrentSetFoo()
functions, but since these are the saved settings, they shouldnt' affect
the torrent's 'is dirty' flag.
2021-11-18 12:19:55 -06:00
Noobsai
0eca3b3c6c
Fix building for XFS ( #2192 )
2021-11-18 11:07:42 -06:00
Charles Kerr
a79a868257
refactor: make tr_variantFromBuf() public ( #2187 )
...
* refactor: add tr_variantFromBuf() and support inplace json/benc parsing
2021-11-17 23:37:35 -06:00
Charles Kerr
36f5d56cfe
fixup! refactor: make piece checksums private ( #2130 ) ( #2190 )
2021-11-17 21:32:34 -06:00
Charles Kerr
617df25ba1
fix: coverity regression reported on 2021-11-17
...
Xref: https://scan5.coverity.com/reports.htm\#v48014/p10174/fileInstanceId\=203957995\&defectInstanceId\=52250103\&mergedDefectId\=1494366
2021-11-17 18:28:16 -06:00
Charles Kerr
f14e741052
fix: some sonarcloud warnings ( #2189 )
...
* fix: pass-large-object-by-reference-to-const warning
Xref: https://sonarcloud.io/project/issues\?id\=transmission_transmission\&issues\=AX0Gz8ze7dx8i2lkKEvq\&open\=AX0Gz8ze7dx8i2lkKEvq
* fix: use-std-array-instead-of-C-array warning
Xref: https://sonarcloud.io/project/issues\?id\=transmission_transmission\&issues\=AX0L8qcgUnpKTxYiu5B-\&open\=AX0L8qcgUnpKTxYiu5B-
* fix: extract-assignment-from-expression
Xref: https://sonarcloud.io/project/issues\?id\=transmission_transmission\&issues\=AX0L8qcgUnpKTxYiu5CH\&open\=AX0L8qcgUnpKTxYiu5CH
* fix: move-include-directives-to-top
Xref: https://sonarcloud.io/project/issues\?id\=transmission_transmission\&issues\=AX0L8qlYUnpKTxYiu5CQ\&open\=AX0L8qlYUnpKTxYiu5CQ
* fix: use-init-statement
Xref: https://sonarcloud.io/project/issues\?id\=transmission_transmission\&issues\=AX0L8qcgUnpKTxYiu5CK\&open\=AX0L8qcgUnpKTxYiu5CK
* fix: use-init-statement
Xref: https://sonarcloud.io/project/issues\?id\=transmission_transmission\&issues\=AX0WPlmBwxvzFbF6whWh\&open\=AX0WPlmBwxvzFbF6whWh
* fix: ensure-move-constructor-is-noexcept
https://sonarcloud.io/project/issues\?id\=transmission_transmission\&issues\=AX0WPlWzwxvzFbF6whWU\&open\=AX0WPlWzwxvzFbF6whWU
* fix: use-init-statement
Xref: https://sonarcloud.io/project/issues\?id\=transmission_transmission\&issues\=AX0bZP20jI_aUyxGBxCD\&open\=AX0bZP20jI_aUyxGBxCD
* fix: replace-redundant-type-with-auto
Xref: https://sonarcloud.io/project/issues\?id\=transmission_transmission\&issues\=AX0bZP0rjI_aUyxGBxCB\&open\=AX0bZP0rjI_aUyxGBxCB
* fix: make-parameter-const
Xref: https://sonarcloud.io/project/issues\?id\=transmission_transmission\&issues\=AX0gkQqqPDVGqE4PY-io\&open\=AX0gkQqqPDVGqE4PY-io
* fix: use-init-statement
https://sonarcloud.io/project/issues\?id\=transmission_transmission\&issues\=AX0rARJbfJ-O-YIDS9xM\&open\=AX0rARJbfJ-O-YIDS9xM
* fix: use-init-statement
Xref: https://sonarcloud.io/project/issues\?id\=transmission_transmission\&issues\=AX0WPlmBwxvzFbF6whWh\&open\=AX0WPlmBwxvzFbF6whWh
* fix: explicitly-delete-copy-ctor
Xref: https://sonarcloud.io/project/issues\?id\=transmission_transmission\&issues\=AX0gkQr6PDVGqE4PY-i4\&open\=AX0gkQr6PDVGqE4PY-i4
* fix: use-init-statement
Xref: https://sonarcloud.io/project/issues\?id\=transmission_transmission\&issues\=AX0bZP9wjI_aUyxGBxCF\&open\=AX0bZP9wjI_aUyxGBxCF
2021-11-17 18:17:09 -06:00
Charles Kerr
ec94c90da9
fix: coverity warnings ( #2186 )
...
* fix: silence check_return warning
Xref: https://scan5.coverity.com/reports.htm\#v48014/p10174/fileInstanceId\=203924665\&defectInstanceId\=52245209\&mergedDefectId\=1494152
* fix: silence check_return warning
Xref: https://scan5.coverity.com/reports.htm\#v48014/p10174/fileInstanceId\=203924692\&defectInstanceId\=52245241\&mergedDefectId\=1493826
* fix: silence check_return warning
Xref: https://scan5.coverity.com/reports.htm\#v48014/p10174/fileInstanceId\=203924667\&defectInstanceId\=52245260\&mergedDefectId\=1493825
* fix: silence nullptr dereference warning
Xref: https://scan5.coverity.com/reports.htm\#v48014/p10174/fileInstanceId\=203924667\&defectInstanceId\=52245260\&mergedDefectId\=1493825
* fix: uninitialized variable in rpc-server z_stream
Xref: https://scan5.coverity.com/reports.htm\#v48014/p10174/fileInstanceId\=203924665\&defectInstanceId\=52245249\&mergedDefectId\=1494151
* fix: silence check_return warning
Xref: https://scan5.coverity.com/reports.htm\#v48014/p10174/fileInstanceId\=203924665\&defectInstanceId\=52245261\&mergedDefectId\=1492904
* fix: silence nullptr dereference warning
https://scan5.coverity.com/reports.htm\#v48014/p10174/fileInstanceId\=203924689\&defectInstanceId\=52245236\&mergedDefectId\=1492890
* fix: silence unchecked return value warning
Xref: https://scan5.coverity.com/reports.htm\#v48014/p10174/fileInstanceId\=203924666\&defectInstanceId\=52245259\&mergedDefectId\=1491888
2021-11-17 15:56:50 -06:00
Charles Kerr
1ba81938bf
refactor: use std::string_view in benc parser ( #2182 )
...
* refactor: use std::string_view to parse benc
* refactor: simplify private parsing API in variant.cc
* chore: remove unneeded includes
* refactor: merge tr_variantFromBenc and tr_variantFromBencFull
2021-11-16 21:29:30 -06:00
Charles Kerr
60b802a22b
refactor: fix some msvc compiler warnings ( #2185 )
...
* refactor: use if-constexpr to silence C4127 warning
* chore: fix C4706 assignment-within-conditional-expression warning
* chore: fix int-widened-to-uint64 warning in tests
2021-11-16 13:25:30 -06:00
Charles Kerr
0fba476917
refactor: fix a -Wshadow warning for a variable named optarg ( #2184 )
2021-11-16 12:31:29 -06:00
Charles Kerr
7344b7e3cb
refactor: add a tr_loadFile() variant that takes a reusable buffer ( #2181 )
2021-11-16 00:15:13 -06:00
Charles Kerr
73edd7b642
refactor: remove tr_variantDictFindStr() ( #2180 )
...
* refactor: remove tr_variantDictFindStr
2021-11-15 23:20:06 -06:00
Charles Kerr
a21594b0ce
refactor: add tr_torrent::renamePath ( #2178 )
2021-11-15 22:10:36 -06:00
Charles Kerr
e7a229e6c3
refactor: tr_sys_path_dirname(), tr_sys_path_basename() now take std::string_view parameters ( #2177 )
...
* refactor tr_sys_path_dirname(), tr_sys_path_basename() now take std::string_views
2021-11-15 18:50:14 -06:00
Charles Kerr
da142f400e
refactor: tr_address_from_string is now std::string_view-friendly ( #2176 )
2021-11-15 17:03:55 -06:00
Charles Kerr
505d2ae428
refactor: tr_torrent.setLocation ( #2175 )
...
member version of tr_torrentSetLocation
2021-11-15 14:53:53 -06:00
Mike Gelfand
e3538f9371
Fix tracker cells rendering in RTL mode (GTK client) ( #2173 )
...
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-11-15 21:53:32 +03:00
Charles Kerr
cef3f43088
refactor: tr_web's callback now uses std::string_view ( #2172 )
...
* refactor: tr_web tasks now use a std::string_view argument
2021-11-15 12:10:18 -06:00
Mike Gelfand
54cd1a2612
Fix torrent cells rendering in RTL mode (GTK client) ( #2170 )
2021-11-15 19:32:41 +03:00
Tomáš Kelemen
d3231ccf7d
web: preferences: add option to alter the download queue ( #2071 )
...
This minor change adds an option to modify the download queue size and
enable/disable the download queue via web interface.
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-11-15 10:20:07 -06:00
Mike Gelfand
cc8ab3f79f
Fix activity filter combo size (GTK client) ( #2169 )
...
For non-C locales, empty string is translated into a multi-line text
containing descriptive translation headers, which then affects cell size
(and in turn, combo widget size) even though that cell is considered a
separator.
2021-11-15 17:25:11 +03:00
Mike Gelfand
a26400c3dc
Fix inconsistent message log action state (GTK client) ( #2167 )
2021-11-15 15:26:44 +03:00
Charles Kerr
250a2e3cc5
refactor: remove unused pieces of str to variant ( #2166 )
...
* feat: add tr_variantInitStrView()
* refactor: remove unused function tr_variantFromJsonFull
* refactor: tr_variantFromJson() now takes a string_view
* refactor: tr_variantFromBenc() now takes a string_view
* refactor: remove unused source arg from tr_variantFromBencFull()
* refactor: make tr_variantFromBuf() private
2021-11-15 01:21:57 -06:00
Charles Kerr
b1aeaa3dcc
refactor: remove tr_variantDictFindStr() from transmission-daemon ( #2165 )
...
* refactor: remove tr_variantDictFindStr from transmission-daemon
2021-11-14 22:49:56 -06:00
Charles Kerr
af8e9e66b9
fixup! refactor: rpc-server.cc ( #2152 ) ( #2164 )
...
fixup: rpc-server auth regression; fix tests
2021-11-14 21:54:48 -06:00
Charles Kerr
8980a33f4a
refactor: tr_webRun() now takes std::string_view args ( #2162 )
2021-11-14 19:17:03 -06:00
Charles Kerr
f46c4c4df9
refactor: remove tr_variantGetStr ( #2160 )
2021-11-14 17:28:37 -06:00
Charles Kerr
6dda4f2b5f
refactor: remove tr_variantDictFindStr() from rpc-server.cc ( #2159 )
...
* refactor: use FindStrview for rpc username
* refactor: use tr_variantDictFindStrView for rpc bind address
2021-11-14 16:06:32 -06:00
Charles Kerr
3bab6f02dc
refactor: rpc-server.cc ( #2152 )
...
* refactor: first baby steps towards C++ifying rpc_server
2021-11-14 15:14:37 -06:00
Charles Kerr
10d3cdb99a
fixup! feat: add tr_strvPath() ( #2134 ) ( #2156 )
...
fix: -Wshadow warning in tr_strvPath()
2021-11-14 13:53:58 -06:00
Charles Kerr
932a72e61d
refactor: remove tr_variantDictFindStr from transmission-gtk ( #2158 )
2021-11-14 13:14:45 -06:00
Charles Kerr
58f13b509f
refactor: remove tr_variantDictFindStr from transmission-edit ( #2157 )
2021-11-14 12:24:30 -06:00
Charles Kerr
9d3791ab1d
refactor: remove tr_variantDictFindStr from transmission-remote ( #2155 )
2021-11-14 11:11:29 -06:00
Charles Kerr
47d41f51bf
build: disable exit-time-destructor warnings in GTK client ( #2154 )
...
* build: disable exit-time-destructor warnings in GTK client
* build: re-enable deprecation warnings (fixed by #2129 )
2021-11-14 10:12:29 -06:00
Charles Kerr
7b772e73e6
fixup! refactor: remove tr_piece struct ( #2059 ) ( #2153 )
...
fix: off-by-one when marking a range of pieces as untested
2021-11-14 10:12:02 -06:00
Mike Gelfand
1c800511d7
Fix torrent counts in tracker filter bar combo (GTK client) ( #2144 )
...
Total count was correct, but per-tracker counts were 1 more than in
reality.
2021-11-14 14:46:33 +03:00
Charles Kerr
3d38e01a13
refactor: tr_session.congestion ( #2151 )
...
* refactor: tr_session.congestion
2021-11-14 00:41:44 -06:00
Charles Kerr
d55474161e
refactor: rpc whitelist ( #2150 )
...
* refactor: make rpc-whitelist string_view-friendly
2021-11-14 00:02:45 -06:00
Charles Kerr
861474e0ce
refactor: tr session.tos ( #2149 )
...
* refactor: make tr_session.tos string_view-friendly
2021-11-13 23:23:19 -06:00
Mike Gelfand
c705e7d9bf
Update AppVeyor AWS credentials
2021-11-14 06:16:11 +03:00
Charles Kerr
99aeaa0eaf
refactor: tr_ssha1(), tr_ssha1_matches() ( #2148 )
...
* refactor: make tr_ssha1 and tr_ssha1_matches string_view-friendly
2021-11-13 20:03:01 -06:00
Charles Kerr
7ff6756ac5
refactor: tr session.blocklist ( #2147 )
...
* refactor: tr_session.blocklist
2021-11-13 19:09:33 -06:00
Charles Kerr
0be95b5074
refactor: tr_session.scripts ( #2146 )
...
* refactor: tr_session.scripts
2021-11-13 17:33:18 -06:00
Mike Gelfand
f0f81f9907
Add missing i18n include to Application (GTK client)
2021-11-14 01:33:16 +03:00
Mike Gelfand
c8d6087759
Avoid implicit narrowing casts in Session (GTK clent)
2021-11-14 01:32:13 +03:00