Commit Graph

309 Commits

Author SHA1 Message Date
Charles Kerr 33a7d131b4
feat: add setting to choose between lazy-verify or full verify (#4611) 2023-01-18 02:09:29 -06:00
Charles Kerr b47c34726b
refactor: tr_peer_socket keeps track of peer count (#4534) 2023-01-04 15:37:55 -06:00
Charles Kerr db38f9aa2c
fix: remove announce ipv4 ipv6 query params (#4502) 2022-12-31 13:13:59 -06:00
Charles Kerr 5ce503f1ab
refactor: udp_core constructor (#4469)
* refactor: udp_core constructor

* refactor: invert dependency between tr_session.publicAddress() and tr_globalIPv6()
2022-12-28 02:03:35 -06:00
Charles Kerr ab9e971903
refactor: tr_globalIPv6() returns a std::optional<tr_address> (#4464) 2022-12-25 07:55:51 -06:00
Charles Kerr 1402cb2949
refactor: add TR_CONSTEXPR20 to make future C++20 migration easier (#4457) 2022-12-23 15:21:40 -06:00
Charles Kerr a1892f2c7c
fix: 4.0.0-beta.2 regression transmission-show --scrape did not exit cleanly (#4447) 2022-12-23 08:03:26 -06:00
Charles Kerr cc4141c619
fixup: 3899255 (#4394) 2022-12-18 11:18:25 -06:00
Charles Kerr 3899255f1c
fix: tear down utp _after_ peer-mgr (#4383) 2022-12-17 14:10:10 -06:00
Charles Kerr 0a69685a4e
refactor: tr_address cleanup (#4338)
* refactor: move tr_tracker_http_announce() helper funcs into their own namespace

* refactor: move tr_globalIPv6() helper funcs into their own namespace

* refactor: move tr_address_is_valid_for_peers() helper funcs into their own namespace

* refactor: make tr_address_compare() a private method

* refactor: rename tr_address::isIPv4() to is_ipv4()

* refactor: use snake_case for tr_address methods

* refactor: make tr_address_is_valid_for_peers() a member function
2022-12-08 20:27:52 -06:00
Charles Kerr e06e304cc8
refactor: fix shutdown order of utp (#4331) 2022-12-06 14:28:48 -06:00
Charles Kerr 22a3a5db25
refactor: peer-socket pt 2 (#4326)
* refactor: tr_netOpenPeerSocket() now takes a tr_address reference

* refactor: disable copy assignment, copy constructor

* refactor: move log statements to peer_socket constructor
2022-12-06 10:28:28 -06:00
Charles Kerr f03fc9270b
Fix/long shutdown crash on shutdown (#4285) 2022-11-30 13:00:34 -06:00
Charles Kerr 14dfafde32
refactor: add std::unique_ptr<evhttp> handler to utils-ev (#4261) 2022-11-28 08:07:04 -06:00
A Cœur d26db72d7e
Fix "Implicit conversion loses integer precision" (#4194) 2022-11-21 10:19:45 -06:00
Charles Kerr d27c4c59ce
refactor: incremental announcer refactor pt. 2 (#4214) 2022-11-18 23:00:25 -06:00
Charles Kerr a45cc2a79d
refactor: try again to use getaddrinfo in announcer_udp (#4201) 2022-11-16 15:13:31 -06:00
Charles Kerr d2125ee965
perf: revert e065565cd to restore async dns lookups (#4182) 2022-11-15 11:16:49 -06:00
Charles Kerr 250e055c1d
fix: warnings from clang tidy sonarcloud coverity (#4143) 2022-11-12 09:53:09 -06:00
Charles Kerr 9e06cf8f2e
refactor: make DHT unblocking (#4122) 2022-11-11 10:09:24 -06:00
Charles Kerr d61e31c419
fix: more thread safety updates (#4136)
* fix: thread safety in tr_sessionLoadTorrents()

* refactor: use std::future in tr_sessionSet()

* refactor: use std::future in tr_sessionClose()
2022-11-10 12:04:49 -06:00
Charles Kerr 7e817b5a43
refactor: fix thread sanitizer warnings in tr_sessionClose() (#4130) 2022-11-09 20:30:34 -06:00
A Cœur 3e0ca88f7d
Fix "Forwarding reference passed to std::move" (#4114)
* Fix "Forwarding reference passed to std::move"

* Missing quotes in file references
2022-11-08 22:33:28 -06:00
Charles Kerr 162035a653
fix: minor recent clang warnings (#4111)
* refactor: fix modernize-use-default-member-init warning in session-thread.cc

* refactor: fix readability-named-parameter warning in session-thread.cc

* refactor: fix clang-diagnostic-unused-function warning for isSupportedSocket()

* refactor: fix clang-analyzer-deadcode.DeadStores warning in buildHandshakeMessage()

* chore: fix readability-identifier-naming warning for tr_session::session_mutex_

* chore: fix readability-identifier-naming warning for Watchdir::generic_rescan_interval_

* chore: fix readability-identifier-naming warning for __tr_current_time
2022-11-07 11:48:26 -06:00
Charles Kerr 4d8509c180
refactor: add libtransmission::evhelpers (#4104) 2022-11-06 15:11:30 -06:00
Charles Kerr 36edd516aa
refactor: replace tr_boundinfo with tr_session::BoundSocket (#4103) 2022-11-06 10:35:48 -06:00
Charles Kerr 831eb8d40f
refactor: make `tr_session_thread` a unique_ptr owned by tr_session (#4069) 2022-11-04 16:20:27 -05:00
Charles Kerr e065565cd4
reafctor: use getaddrinfo() instead of evdns (#4094) 2022-11-04 13:29:56 -05:00
Charles Kerr 09bb1a60f0
refactor: add more nodiscard, constexpr, and noexcept (#4089) 2022-11-03 18:08:02 -05:00
Charles Kerr ee8a6bd130
refactor: simplify blocklist code (#4086) 2022-11-03 15:46:27 -05:00
Charles Kerr 611d36ac84
refactor: decouple session settings from the session class (#4053) 2022-11-01 19:32:26 -05:00
Charles Kerr cdf817f2e7
fix: FTBFS on Windows (#4036)
* refactor: getPiececLength() now returns size_t

* refactor: tr_torrentSetMetadataPiece() length arg is now size_t

* refactor: tr_peerIo::flushOutgoingProtocolMsgs() returns size_t, takes a tr_error** for reporting errors

* refactor: define tr_mode_t for convenience

* fix: suseconds_t portability fix
2022-10-28 19:12:37 -05:00
A Cœur 12e564096b
fix: "Implicit conversion loses integer precision" warnings (#3960) 2022-10-25 11:14:42 -05:00
Charles Kerr 798e873b87
fix: sonarcloud warnings (#4023) 2022-10-24 22:13:09 -05:00
Charles Kerr d191a04228
refactor: decouple tr_announcer_udp (#4002) 2022-10-21 13:15:14 -05:00
Charles Kerr c8e652c820
refactor: add dns interface class (#3977) 2022-10-17 14:41:42 -05:00
Charles Kerr 79068c512a
refactor: decouple tr-dht from peerMsgs, peerMgr (#3966)
* refactor: decouple peer-mgr from tr-dht

* refactor: remove tr_dhtPort()

* refactor: decouple peer-msgs from tr-dht

* refactor: make tr_udp_core.udp_port_ const

* refactor: rename tr_udp_core::dhtUninit() as startShutdown()
2022-10-15 08:22:43 -05:00
Charles Kerr 4a359fd481
refactor: session private fields (#3961)
* refactor: make tr_session.private_peer_port a private field

chore: make tr_session.public_peer_port a private field

* refactor: make tr_session.web_ a private field

* refactor: make tr_session.lpd_ a private field

* refactor: make tr_session.bind_ipv4_ private

refactor: make tr_session.bind_ipv6_ private

* refactor: make tr_session.bandwidth_groups_ private; add const accessor

* refactor: make tr_session.port_forwarding_ private

* refactor: make tr_session.peerMgr private pt 1: add tr_session::addIncoming()

* refactor: make tr_session.peerMgr private pt 1: add tr_session::addTorrent()

* refactor: make tr_session.peer_mgr_ private

* refactor: make tr_session.setPeerPort() private
2022-10-13 21:25:02 -05:00
Charles Kerr a2817faab1
refactor: tr_session declaration cleanup (#3958)
* chore: move private tr_session struct declaration to beginning of class

* chore: move all tr_session fields into the same code section

* chore: move private constexpr, const fields before mutable ones

* chore: move trivial fields before nontrivial fields

* chore: reconcile with refactor/session-const-fields-first
2022-10-13 16:25:54 -05:00
Mike Gelfand f1f55cc3df
Sync translations (#3939)
* Sync translations with code

* Sync translations with Transifex

* Remove Mac menu title that isn't displayed and shouldn't be translated

* Add context to logging level strings in GTK client

* Use "µTP" consistently in code

* Use ellipsis instead of three docs in Qt client strings

* Close HTML tags in blocklist-related strings

* Remove trailing space from a translatable string in Qt client

* Add missing plural forms for English strings in Qt client

* Fix spelling: metaInfo -> metainfo
2022-10-11 18:39:41 +03:00
Charles Kerr 3bb8f3c03f
fixup: new clang-tidy warnings (#3863) 2022-10-02 17:56:58 -05:00
Charles Kerr 257d98545b
refactor: add tr_port_forwarding::Mediator (#3855)
* refactor: add a Mediator class to decouple tr_session and tr_port_forwarding

* refactor: add tr_port_forwarding::Mediator::privatePeerPort()

* refactor: add tr_port_forwarding::Mediator::onPortForwarded()

* chore: avoid unnecessary include of timer.h in other headers

* refactor: use a uniform timerMaker() API in mediators
2022-10-01 09:12:49 -05:00
Harm133 467be24358
Blocklist/Session: move loadBlocklists function to BlockListfile struct (#3854) 2022-09-30 18:29:26 -05:00
Charles Kerr bf156a97cf
refactor: port forwarding (#3850)
* refactor: rename state enum type as tr_port_forwarding_state

* chore: use snake_case for tr_shared struct fields

* refactor: replace tr_shared with tr_port_forwarding

* refactor: make tr_natpmp_state an enum class

* refactor: uniform naming for port-forwarding module

* refactor: move output-only parameters in tr_natpmp::pulse() to return struct

* fix: use a nullptr multicastif if bindaddr is empty

* chore: use PascalCase for enum class values

* chore: clean up port-forwarding #includes

* chore: remove unused tr_port_forwarding::peerPort()
2022-09-30 08:59:10 -05:00
Charles Kerr a5ca289f41
fix: #3847 crash on session close (#3849)
* chore: use typesafe sin_addr assignment instead of memcpy()

* refactor: make tr_dhtPrintableStatus private

* refactor: make tr_dhtStatus() private

* refactor: make tr_dht status enum private

* refactor: add safety mutex wrapper around libdht API calls

* refactor: make tr_dht::Status an enum class

* refactor: rename private functions

* refactor: const correctness

* refactor: use typesafe assignment instead of memcpy

* refactor: tr_session does not directly call tr_dht

* refactor: tr_dhtPort() returns std::optional

* refactor: use tr_address::fromCompact4 in tr-dht.cc
2022-09-29 09:12:33 -05:00
Charles Kerr 56e0a1bda8
chore: add cppcoreguidelines-pro-type-member-init to libtransmission/.clang-tidy (#3840) 2022-09-23 00:51:15 -05:00
Charles Kerr 228efa16e3
refactor: tr_globalIPv6() returns a std::optional<in6_addr> (#3836) 2022-09-21 23:59:31 -05:00
Dmitry Antipov 243ab1058d
refactor: fold session UDP innards into C++ class (#3794)
* Use std::unique_ptr to manage UDP core object

N.B.: it's no longer valid to call socket adjustments quirks from
tr_sessionSetUTPEnabled() because the corresponding object may be
not created yet. We have to create (or re-create) it explicitly
(like it's done in tr_sessionSetDHTEnabled()) or just set
is_utp_enabled_ flag of the session and assume that socket
adjustments will be done later when the object is constructed.
2022-09-21 13:25:53 -05:00
Charles Kerr 806a6382d7
fixup new minor warnings (#3786)
* fixup! Add fallback for copy_file_range EXDEV error (#3756)

* fixup! refactor: use readability-identifier-naming in clang-tidy (#3784)
2022-09-07 12:41:01 -05:00
Charles Kerr 82212ff1d8
refactor: move the verify worker thread into a wrapper class (#3775) 2022-09-05 23:43:59 -05:00