Commit Graph

13683 Commits

Author SHA1 Message Date
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
Charles Kerr 3b72a1feea
refactor: use C++ inheritance for tr_peer, tr_peerMsgs, and tr_webseed (#1877)
* refactor: use C++ inheritance for tr_peer, tr_peerMsgs, and tr_webseed
2021-10-07 08:33:55 -05:00
Charles Kerr 83f21b8e0e
refactor: prefer constexpr functions over static inline ones (#1887)
* refactor: prefer constexpr functions over static inline ones
2021-10-06 17:24:04 -05:00
Charles Kerr f876a100a0
refactor: add [[fallthrough]] annotation (#1886) 2021-10-06 12:24:02 -05:00
Charles Kerr 003685b40a
refactor: use nullptr instead of NULL (#1884)
* refactor: use nullptr instead of NULL.

No functional changes; just more C++ification
2021-10-06 11:32:17 -05:00
Charles Kerr cc204e0b2c
refactor: prefer "using" over "typedef" (#1883)
* refactor: prefer "using" over "typedef"
2021-10-06 09:26:07 -05:00
Charles Kerr 035ca23226
fix: sonarcloud false error from O_SEQUENTIAL use. (#1882)
Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AXvcFXmBqMngl89XhIRU&open=AXvcFXmBqMngl89XhIRU
2021-10-06 08:09:16 -05:00
Charles Kerr 396afd8a42
refactor: remove unused tr_variant_string.session (#1881)
This was assigned but never used. Shrinks sizeof(tr_bandwidth) by 8 bytes.
2021-10-05 19:06:18 -05:00
Charles Kerr 3b49fa993c
refactor: remove unused tr_variant_string.quark (#1880)
This was assigned but never used. Shrinks sizeof(tr_variant) by 8 bytes.
2021-10-05 14:33:02 -05:00
Charles Kerr 8983af7e46
refactor: make some tr_session methods private (#1879)
These public methods weren't used anywhere except in tr_session, so make
them private.

tr_sessionGetAltSpeed_Bps()
tr_sessionGetPieceSpeed_Bps()
tr_sessionGetRawSpeed_Bps()
tr_sessionSetAltSpeed_Bps()
tr_sessionSetSpeedLimit_Bps()
2021-10-05 13:54:02 -05:00
Mike Gelfand c8d0c8db2e Switch from zip to 7z for PDBs archive on AppVeyor
This reduces its size by more than 1.5 times.
2021-10-05 20:33:09 +03:00
Charles Kerr 6b7f2f9e53
refactor: make tr_info.errorString a const char*. (#1878)
this field now points to tr_torrent.errorString instead of copying into
a standalone char array.

old: sizeof(tr_torrent) 2640
new: sizeof(tr_torrent) 2136
2021-10-05 12:23:07 -05:00
Charles Kerr 976fec6e94
refactor: make mime-type array inline constexpr (#1872)
* refactor: make mime-type array inline constexpr

* fix: iwyu <iterator> for std::back_inserter

* fix: remove newly-unused variable in mime-types.js
2021-10-01 17:55:19 -05:00
Charles Kerr 6b71050000
fix: recent regressions (#1873)
* fixup! refactor: use std::set in tr_webseed (#1847)

fix: use placement new to instantiate tr_webseeds.tasks

* fixup! refactor: use std::string in tr_scrape_response (#1866)

fix: avoid assigning a nullptr to std::string

* fixup! refactor: use std::string in tr_scrape_response (#1866)

fix: avoid assigning a nullptr to std::string
2021-10-01 16:57:30 -05:00
Charles Kerr 916d418824
fix: some Coverity regressions reported on 2021-09-16 (#1870)
* fix: coverity regressions reported on 2021-10-01

leaks introduced by 3fd5c81a

* fix: resource leak in test utility filesAreIdentical()

* fix: use-after-free warning in test code for tr_urlParse()

* fix: false warning for unterminated c string

* fix: false unchecked return value in test code

cid 1491881

* fix: unterminated c string in test code

cid 1491890

* refactor: slightly better assertions in file-test
2021-10-01 15:28:01 -05:00
Charles Kerr b546fd423f
fix: sonarcloud getopt warnings (#1871)
* fix: sonarcloud out-of-bound memory access warning

* fix: sonarcloud out-of-bound memory access warning

* fix: sonarcloud 64-to-32 narrowing warning
2021-10-01 12:47:23 -05:00
Charles Kerr c87d22d53f
fix: coverity regressions reported on 2021-10-01 (#1869)
leaks introduced by 3fd5c81a
2021-10-01 08:21:05 -05:00
Charles Kerr 392c375b17
refactor: use std::vector in tau_announce_request (#1868) 2021-10-01 07:18:49 -05:00
Charles Kerr d8af31a866
refactor: use std::string in tau_tracker (#1867) 2021-10-01 06:29:53 -05:00
Charles Kerr 3fd5c81a22
refactor: use std::string in tr_scrape_response (#1866) 2021-09-30 16:33:31 -05:00
Charles Kerr 14fc626943
refactor: use std::vector for tau_scrape_request.payload (#1865) 2021-09-30 14:00:02 -05:00
Charles Kerr a76cf22211
refactor: use std::map for tr_announcer.scrape_info (#1864)
* refactor: use std::map for tr_announcer.scrape_info
2021-09-30 13:18:46 -05:00
Charles Kerr 7c4f66c44e
refactor: use a std:: container in getBlockRequestPeers() (#1863)
* refactor: use std::vector in getBlockRequestPeers()
2021-09-30 10:08:34 -05:00
Charles Kerr 766d95b352
refactor: use std::vector in rechokeUploads() (#1862) 2021-09-30 09:20:55 -05:00
Charles Kerr 5395e2e545
refactor: use std::vector and std::array in quark.cc (#1861)
* refactor: use std::vector and std::array in quark.cc
2021-09-30 07:01:04 -05:00
Charles Kerr e47762c7ca
refactor: use std::vector in extract_parts_from_multipart() (#1860)
* refactor: use std::vector in extract_parts_from_multipart()
2021-09-29 21:14:31 -05:00
Charles Kerr 78e571d6f2
refactor: use std::set in tr_announcer.stops (#1859)
* refactor: use std::set for tr_announcer.stops
2021-09-29 18:42:50 -05:00
Charles Kerr 20b5a8c62b
refactor: use std::vector in tr_sessionGetNextQueuedTorrents (#1858) 2021-09-29 17:21:04 -05:00
Charles Kerr 27068cb4a6
refactor: use std::unordered_set in loadBlocklists (#1857)
* refactor: use std::unordered_set in loadBlocklists
2021-09-29 16:23:34 -05:00
Charles Kerr baafb68bfd
refactor: use std::unordered_set for tr_torrent.labels (#1856) 2021-09-29 14:52:19 -05:00
Charles Kerr e03bc8e5bc
refactor: replace tr_ptrArray with std::unordered_set in tr_watchdir_scan() (#1854)
* replace tr_ptrArray with std:: in tr_watchdir_scan
2021-09-29 12:25:52 -05:00
Charles Kerr 055a8ecb4d
refactor: use std::set in deleteLocalData() (#1853) 2021-09-29 10:22:04 -05:00
Charles Kerr b413e934ba
in variant-benc, use std::deque not tr_ptrArray (#1851) 2021-09-28 19:09:01 -05:00
Charles Kerr e2f0432146
in variant-json, use std::deque not tr_ptrArray (#1850) 2021-09-28 08:56:46 -05:00
Charles Kerr 7d2f65455c
refactor: remove unused tr_list code (#1849) 2021-09-27 17:57:20 -05:00
Charles Kerr 16a70e57d2
refactor: use std::set in verify.cc's verifyList (#1848)
* refactor: use std::set in verify.cc
2021-09-27 17:07:58 -05:00
Charles Kerr 2554adba9c
refactor: use std::set in tr_webseed (#1847) 2021-09-27 14:28:11 -05:00
Charles Kerr 12f052621d
refactor: replace tr_list with std::list in tr_session.blocklists (#1846) 2021-09-27 13:28:41 -05:00
Charles Kerr c42a6c785d
refactor: replace tr_list with std::set in web.cc (#1845) 2021-09-27 11:27:02 -05:00
Charles Kerr 3504933fba
refactor: replace tr_list with std::list in rpc-server whitelists (#1844) 2021-09-27 10:03:54 -05:00
Charles Kerr 96d3559a18
refactor: replace tr_list with std::list in tr_getWebClientDir() (#1843) 2021-09-27 08:45:21 -05:00
Charles Kerr 643074e7bb
refactor: use std::list in variant-json.cc (#1842)
* refactor: replace tr_list with std::deque in variant-json.cc struct ParentState
2021-09-27 07:46:38 -05:00
Charles Kerr 78d2074335
refactor: replace tr_list with std::list in sessionLoadTorrents() (#1841) 2021-09-26 17:23:11 -05:00