Commit Graph

13725 Commits

Author SHA1 Message Date
Oleg Chashko 2bd2f0738e
fix: macOS gui with Russian l10n does not fit lines of text. (Fixes #1963) (#1973)
* Fixed: #1963

* Fixed: (✕) -> Changed to (No Group) & (None)

* Fixed: Удалённое управление -> Удалённый доступ

* Удаленное управление -> Удалённый доступ
2021-10-17 13:45:25 -05:00
Charles Kerr 2bc9959dc9
refactor: cppcoreguidelines-init-variables pt. 5 (#1970)
* fix: uninitialized variables in torrent.cc
2021-10-17 12:06:00 -05:00
Charles Kerr 4aba9b623f
fix: assertion failure in bitfield::bitfield(flags, n) (#1976)
* fix: bitfield construct-from-bool-array regression
2021-10-17 10:34:36 -05:00
Mike Gelfand de7b7a284c Only pack PDBs on master and tags to reduce AppVeyor artifacts size 2021-10-17 14:04:18 +03:00
Mike Gelfand 08996ab4c7
Don't pack PDBs on feature branches to reduce AppVeyor artifacts size (#1972) 2021-10-17 02:23:48 +03:00
Charles Kerr 290f7fc71a
fix: cppcoreguidelines-init-variables pt. 4 (#1965)
* fix: uninitialized variables in resume
2021-10-16 11:17:34 -05:00
Dmytro Lytovchenko 953f07375a
Modernize bitfield.cc: Storage changes and refactor (#1927)
* Modernize bitfield.cc: Storage changed to vector of bytes, return vector from getRaw, new Span readonly memory view
Modernize bitfield.cc: Code style/review notes
Modernize bitfield.cc: Code format

* Modernize bitfield.cc: Swap end and begin in bit counting code assertion

* Modernize bitfield.cc: Rewrite states and simplify code

* Modernize bitfield.cc: Fixing the code and tests

* Modernize bitfield.cc: Fixing tests

* Modernize bitfield.cc: Formatting; +std::size, +const
2021-10-16 09:04:19 -05:00
Charles Kerr 43ad1346eb
refactor: tr_torrentInfoGetMagnetLink now takes a std::string_view (#1968)
* refactor: tr_torrentInfoGetMagnetLink now takes a std::string_view
2021-10-16 08:20:04 -05:00
Charles Kerr 7b423b7e0d
refactor: tr_utf8clean now takes a std::string_view (#1967) 2021-10-15 20:02:40 -05:00
Charles Kerr 7e5e1f3812
refactor: tr_rpc_parse_list_str() takes a std::string_view (#1966) 2021-10-15 18:34:22 -05:00
Charles Kerr 3e7b8eb7bb
refactor: tr_parseNumberRange() takes a std::string_view (#1962)
* tr_parseNumberRange() now takes a std::string_view
2021-10-15 17:15:33 -05:00
Sander van Kasteel d11ccf113c
Added primitive CORS header support (#1885)
* Copied over patch from github user fecristovao

* Added nullptr check
2021-10-15 15:10:09 -05:00
Charles Kerr fb39c4663c
Fix/benc zero length dict key (#1964)
* fix: benc decoding bug that failed to parse hybrid torrents
2021-10-15 13:13:33 -05:00
Charles Kerr 23d85458f8
fix: cppcoreguidelines-init-variables pt. 3 (#1954)
* refactor: fix uninitialized variable warnings in variant code

* refactor: fix uninitialized variable warnings in web, webseed
2021-10-15 12:27:12 -05:00
Charles Kerr 567f1e48c8
tr_quark_new() now takes a std::string_view (#1961) 2021-10-15 08:28:47 -05:00
Charles Kerr c98b4d33c3
refactor: use C++'s [[noreturn]] atrribute (#1960) 2021-10-14 22:16:52 -05:00
Charles Kerr f0171668c6
refactor: use C++ static_assert; remove TR_STATIC_ASERT (#1959) 2021-10-14 15:40:35 -05:00
Charles Kerr fd5804fbb7
refactor: add readability-else-after-return to clang-tidy (#1956)
* refactor: add readability-else-after-return to clang-tidy
2021-10-14 14:26:38 -05:00
Oleg Chashko b0f36a9841
Fix: issue #1940 (#1955)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-10-14 13:18:18 -05:00
Johan 04f8b82308
Add total disk space to free-space RPC request (#1682)
* Add total space to free-space endpoint

* Update docs
2021-10-14 12:07:16 -05:00
Charles Kerr ab82e155be
build: add clang tidy modernize loop convert (#1949)
* build: add clang-tidy check modernize-pass-by-value

* build: add clang-tidy check modernize-loop-convert

* refactor: constexpr

* refactor: make preallocGuess a std::array
2021-10-14 10:36:49 -05:00
Charles Kerr 5df6e4f88f
fix: uninitialized variables in announcer (#1936) 2021-10-14 09:22:28 -05:00
Rosen Penev 1f48884726
fix runtime with wolfSSL and fastmath (#1950)
wolfSSL's fastmath support requires options.h to be included before
anything else. Otherwise bad codepaths get taken and a crash occurs
during DH initialization.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-10-13 22:48:04 -05:00
Charles Kerr af2af2a57e
build: add clang-tidy check modernize-pass-by-value (#1946) 2021-10-13 19:14:27 -05:00
Charles Kerr 65a3a7d042
build: have clang-tidy check for NULL in libtransmission (#1945) 2021-10-13 18:12:51 -05:00
Oleg Chashko 5947329a51
Fix: issue #1889, #1894, #1912, #1913 (#1923)
* Fix: issue #1889

* Fix: issue #1894

* Fix: issue #1912

* Fix: issue #1913
2021-10-13 11:04:10 -05:00
Charles Kerr 306f0c4b80
fix: uninitialized variables pt 1: peer-mgr.cc (#1932)
* fix: uninitialized variables in peer-mgr.cc
2021-10-13 10:08:37 -05:00
Charles Kerr 98e16a178f
refactor: add an enumeration of the script types (#1934)
* refactor: add an enumeration of the script types

This simplifies the API by having a single set of functions that can be
used for getting/setting all the script types.
2021-10-12 22:46:12 -05:00
Charles Kerr 16dcc224ec
feat: add rpc-version-semver to RPC's session-get (#1935)
* feat: add rpc-version-semver to RPC's session-get
2021-10-12 22:03:28 -05:00
Charles Kerr ba6513ed4a
feat: add an option to run a script when a torrent is added (#1896)
Co-authored-by: cfpp2p <cfpp2p>
2021-10-12 16:32:32 -05:00
Kirill Ovchinnikov 4daaea9ff1
Replace NULL back with nullptr (mistake after auto-rebase) (#1933) 2021-10-12 14:45:18 -05:00
Kirill Ovchinnikov 53e5200968
Slashes fixes (#857)
* Fix 409/404 error when request URI is exactly equal with server URL

* Fix 409/404 error when user requests "/web" path without trailing slash

* Fix errors when "rpc_url" setting has no trailing slash

* Code style fixes

* rpc-server.c: code refactoring and minor fixes

* Minor code style fix

* rpc-server.c: handle_request refactoring

Co-Authored-By: uprt <15909793+uprt@users.noreply.github.com>

* rpc-server.c: minor refactoring

Co-Authored-By: uprt <15909793+uprt@users.noreply.github.com>

* Fix clang-format warning

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-10-12 09:28:46 -05:00
Charles Kerr 62372602b4
refactor: run clang-tidy on bandwidth.h, .cc (#1930)
* chore: allow vararg calls in qt/.clang-tidy

An awkward PR since this isn't intended for the qt/ codebase at all, but
rather for use with libtransmission instead. But libtransmission is *so*
noncompilant at this point that this config can't be promoted higher up
the tree yet. Instead, it needs to be callable on-request by devs.

* refactor: make clang-tidy happy with bandwidth.h, .cc

* refactor: use getFooSpeedBytesPerSecond()
2021-10-12 01:04:22 -05:00
Charles Kerr 148de2da94
chore: allow vararg calls in qt/.clang-tidy (#1929)
let clang-tidy allow C-style vararg functions
2021-10-11 17:37:43 -05:00
Charles Kerr 02b9e17207
refactor: make tr_peerIo a class (#1928)
* refactor: make tr_peerIo a class

No behavioral changes.

Use `new` and `delete` and change `struct` references to `class`.

* refactor: make some tr_peerIo fields const

* refactor: reorganize tr_peerIo fields to remove padding holes

* refactor: remove redundant field tr_peerIo.isIncoming

* refactor: make tr_peerIo.inbuf, .outbuf fields const*
2021-10-11 16:54:16 -05:00
Charles Kerr 8f8d6e5db2
refactor: remove padding holes from Bandwidth (#1926)
Another pahole patch. No functional changes; just rearranging fields.

old sizeof(Bandwidth): 848
new sizeof(Bandwidth): 816
2021-10-11 13:11:24 -05:00
Dmytro Lytovchenko 39376f2105
Modernize/bitfield.cc: Make into C++ (#1917)
* Modernize bitfield.cc: Grouped member functions into the struct; C++ construction

* Modernize bitfield.cc: Naming style similar to qt/ C++ source

* Modernize bitfield.cc: Bitfield test updated to new API

* Modernize bitfield.cc: Renames for private functions

* Modernize bitfield.cc: Formatting

* Modernize bitfield.cc: Remove struct in 'struct Bitfield' and update commented code too

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-10-11 12:29:14 -05:00
Dinesh Manajipet ac41837ae9
Feature: Support Batch Adding Tracker Urls in Qt UI (#1161)
Adding tracker urls one at a time is very tedious.
This lEts you add multiple tracker urls at oNce, 1 trAcker url per line.
As a bonus, this also takes care of trailing spaces when pasting urls.

Fixes #1148
And this seems to be a requested feature:
https://forum.transmissionbt.com/viewtopic.php?t=18958

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-10-10 22:19:36 -05:00
Charles Kerr 1fb5a79813
refactor: use maybe unused attribute (#1918)
* refactor: replace TR_UNUSED with [[maybe_unused]]
2021-10-10 11:52:26 -05:00
Dmytro Lytovchenko a4d7e11a14
Bandwidth.cc bring naming closer to C++ style of code in qt/ (#1914)
* Modernize bitfield.cc: Rename tr_bandwidth to Bandwidth; Move dependent structs and consts into it

* Modernize bitfield.cc: Rename internal fields to lower_snake_case_ with suffix underscore

* Modernize bitfield.cc: Remove struct in 'struct Bandwidth' type usages

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-10-09 20:12:03 -05:00
Charles Kerr 0783e9691d
refactor: make tr_swarm a class (#1915) 2021-10-09 19:13:40 -05:00
Dmytro Lytovchenko c287b82c00
Modernize bandwidth.cc: Moved functions inside struct (#1895)
* Modernize bandwidth.cc: Move functions inside struct

* Modernize bandwidth.cc: Review notes - remove extraneous checks, move small functions into .H file, etc

* Modernize bandwidth.cc: Construction and destruction is now via C++ new/delete

* Modernize bandwidth.cc: Rename used() to notifyBandwidthConsumed()

* Modernize bandwidth.cc: Children is now unordered_set

* Modernize bandwidth.cc: Allocation functions for peer bandwidth are now using std::vector instead of ptrArrays

* Modernize bandwidth.cc: Code formatting

* Modernize bandwidth.cc: Private fields after public; Minor review notes

* Modernize bandwidth.cc: Ungroup enums into constants; Docs minor update

* Modernize bitfield.cc: Docs comments changes; Using constexpr instead of const

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-10-09 07:52:09 -05:00
Charles Kerr 1ba64684f9
refactor: C++ify clients.cc (#1907)
* refactor: use C++17 for clients.cc
2021-10-08 21:46:10 -05:00
Charles Kerr e9a264f29d
fix: minor dead store assignment warning in buildHandshakeMessage() (#1901) 2021-10-08 10:41:57 -05:00
shelvacu d2241cda67
Explain port-forwarding-enabled (#1900)
I'm basing this information on 454f55a9a2/gtk/tr-prefs.cc (L1185-L1186) which if I'm interpreting it right means that the same setting is labeled as "Use UPnP or NAT-PMP port forwarding from my router".
2021-10-08 09:10:34 -05:00
Charles Kerr 454f55a9a2
fixup! refactor: prefer constexpr functions over static inline ones (#1887) (#1899)
do not declare tr_peerMsgs as both a struct and a class
2021-10-07 20:12:53 -05:00
Charles Kerr 93f5ad8767
fix: dead store warning in torrent.cc when building without assertions (#1898) 2021-10-07 18:44:43 -05:00
Dmytro Lytovchenko 2312965285
Suggested modernization steps for each *.CC module (#1801)
* Suggested modernization steps
2021-10-07 12:18:44 -05:00
Charles Kerr 435f17641a
Don't set the path attribute when setting a cookie. (#1893)
Co-authored-by: Robert Crowston <crowston@protonmail.com>
2021-10-07 11:16:09 -05:00
Charles Kerr 959cbe2c64
web: fix sorting of renamed torrents by name (#1892)
Co-authored-by: Benedikt Morbach <benedikt.morbach@googlemail.com>
2021-10-07 09:44:28 -05:00