Commit Graph

23 Commits

Author SHA1 Message Date
Charles Kerr b0ee4007ff
refactor: include cleanups (#2392)
* refactor: include <memory> when using shared_ptr or unique_ptr

* refactor: include <cstdio> iff we use it

* refactor: include <cstring> iff we use it

* refactor: include <cstdlib> iff we use it

* refactor: include <string_view> or <string> iff we use it

* refactor: include <array> iff we use it

* refactor: include <ctime> iff we use it

* refactor: include <cctype> iff we use it

* refactor: misc #include cleanups in libtransmission
2022-01-12 20:13:58 -06:00
Charles Kerr dd1379b0b6
refactor: add tr_interned_string (#2332) 2021-12-23 11:16:05 -06:00
Charles Kerr e4a172d39c
fix: sonarcloud (#2322)
* fix: sonarcloud warning - redundant cast

* fix: sonarcloud warning - init-statement

* fix: sonarcloud warning - init-statement

* fix: sonarcloud warning - move #include to top of file

* fix: sonarcloud warning - implicit conversion loses precision

* fix: sonarcloud warning - confirm safe use of strlen

* fix: sonarcloud warning - refactor code to not nest more than three deep

* iwyu: cstring

* iwyu: algorithm
2021-12-16 16:58:58 -06:00
Charles Kerr e65e0b3caa
refactor: prefer tr_strv*() even more (#2318) 2021-12-15 23:16:40 -06:00
Charles Kerr 2277fde4e0
refactor: prefer tr_strv*() funcs (#2317) 2021-12-15 20:09:46 -06:00
Charles Kerr 42b1362760
refactor: tidy libtransmission includes (#2316) 2021-12-15 15:25:42 -06:00
Charles Kerr 7724111a8b
refactor: increase use of tr sha1 digest t (#2091)
* refactor: make tr_sha1_digest_t an array of std::byte

* refactor: increase use of tr_sha1_digest_t
2021-11-03 19:55:04 -05:00
Charles Kerr 9dca5f2086
perf: intern the announcer module's URL strings (#2085)
* perf: intern the announcer module's internal URLs
2021-11-02 18:00:01 -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 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 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 16e9a99fe9
refactor: clang-tidy --fix modernize-deprecated-headers (#1980) 2021-10-17 15:17:18 -05:00
Charles Kerr 5df6e4f88f
fix: uninitialized variables in announcer (#1936) 2021-10-14 09:22:28 -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 cc204e0b2c
refactor: prefer "using" over "typedef" (#1883)
* refactor: prefer "using" over "typedef"
2021-10-06 09:26:07 -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 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
Dmytro Lytovchenko 43d1ece562
C++ modernization: Replace NULLs with typesafe nullptrs (#1799)
Fixing CI errors and build errors
Reverted changes: NULL in EV_SET macro; Clang-formatting
Reverted changes: MacosX *.m files reverted from master
2021-09-14 19:18:09 -05:00
Charles Kerr 4c1b627647
refactor: port libtransmission to C++ (#1787)
Port libtransmission to C++. This PR doesn't refactor everything to c++.
Its code changes are only what was necessary to compile and link as c++.
See libtransmission/README.md for details on how to submit modernization 
patches!

Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2021-09-12 12:41:49 -05:00
Renamed from libtransmission/announcer-udp.c (Browse further)