Commit Graph

640 Commits

Author SHA1 Message Date
Charles Kerr bfec98c323
refactor: avoid tr_new() in transmission-remote (#3665) 2022-08-17 20:25:42 -05:00
Charles Kerr e49747ab51
feat: add tr_strvToBuf() (#3657)
* feat: add tr_getDefaultConfigDirToBuf()

* feat: add tr_getDefaultDownloadDirToBuf()

* feat: add tr_strvToBuf()

* feat: add tr_torrentFindFileToBuf()

* feat: add tr_torrentGetMagnetLinkToBuf()

* refactor: remove unused makeString() from tests

* feat: add tr_torrentFilenameToBuf()

* feat: add tr_torrentGetTrackerListToBuf()

* chore: remove obsolete comment references to tr_free

* chore: remove unused tr_strdup()

* chore: remove unused forward declarations
2022-08-16 19:28:57 -05:00
Charles Kerr 0fbfed60b1
refactor: make tr_session.speed_limit_Bps_ private (#3645)
* refactor: make tr_session.speed_limit_Bps_ private

* refactor: make tr_session.is_utp_enabled_ private

* refactor: make tr_session.is_prefetch_enabled_ private

* refactor: make tr_session.is_ratio_limited_ private

* refactor: make tr_session.upload_slots_per_torrent_ private

* refactor: make tr_session.peer_id_ttl_hours_ private

* refactor: make tr_session.blocklists_ private

* refactor: make tr_session.umask_ private

* refactor: make tr_session.evdns_base_ private

* fixup! refactor: make tr_session.blocklists_ private

* refactor: make tr_session.default_trackers_ private

* refactor: make tr_session.idle_limit_minutes_ private

* refactor: make tr_session.WebMediator private

* refactor: make tr_session.session_id_ private

* refactor: make tr_session.peer_socket_tos_ private
2022-08-15 12:48:05 -05:00
Charles Kerr a4c1a23fae
refactor: make tr_session.is_incomplete_file_naming_enabled_ private (#3642)
* refactor: make tr_session.is_incomplete_file_naming_enabled_ private

* refactor: make session callback setters constexpr

* refactor: make tr_session.is_port_random_ private

* refactor: make tr_session.desired_ratio_ private

* refactor: make tr_session.is_pex_enabled_ private

* refactor: make tr_session.is_idle_limited_ private
2022-08-14 19:33:28 -05:00
Charles Kerr 44a291ca39
refactor: remove tr_session nonmember functions (#3641) 2022-08-14 14:41:57 -05:00
Charles Kerr 5c8695025a
refactor: make tr_session.is_closing_private_ (#3637) 2022-08-13 20:04:36 -05:00
Charles Kerr dab81c1af6
fix: readability-inconsistent-declaration-parameter-name warnings in libtransmission (#3572) 2022-08-03 01:15:37 -05:00
Charles Kerr 9c7fcf85cf
refactor: tr_stats (#3542) 2022-07-28 18:56:40 -05:00
Charles Kerr 4f7051fe7f
refactor: make tr_session's directory fields private (#3516) 2022-07-23 02:13:18 -05:00
Charles Kerr 47fe7c47d2
refactor: replace per-torrent callbacks with per-session ones. (#3495) 2022-07-23 01:04:34 -05:00
Charles Kerr 445aad56a0
test: add platform tests (#3514)
* test: add tr_getDefaultDownloadDir() tests

this also indirectly tests xdg and homedir

* test: add PlatformTest.defaultConfigDirEnv

* test: add PlatformTest.defaultConfigDirXdgConfig

test: add PlatformTest.defaultConfigDirXdgConfigHome

* test: add PlatformTest.webClientDirEnvClutch

test: add PlatformTest.webClientDirEnvTr

test: add PlatformTest.webClientDirXdgDataHome

* fixup! test: add PlatformTest.webClientDirEnvClutch

fix: win32 breakage
2022-07-22 20:10:02 -05:00
Charles Kerr 0da1cbb6ec
fix: 3508 location invalidation (#3511)
* Revert "refactor: remove tr_sessionGetConfigDir() (#3506)"

This reverts commit c50da43ae0.

* Revert "fix: do not leak in tr_getWebClientDir() (#3502)"

This reverts commit 5a75e37033.
2022-07-22 00:52:48 -05:00
Charles Kerr c50da43ae0
refactor: remove tr_sessionGetConfigDir() (#3506)
* refactor: remove tr_sessionGetConfigDir() from GTK client

* refactor: remove tr_sessionGetConfigDir() from daemon

* refactor: remove tr_sessionGetConfigDir()

* refactor: remove tr_getTorrentDir()

* fixup! refactor: remove tr_sessionGetConfigDir()
2022-07-21 20:12:45 -05:00
Charles Kerr da032e3875
refactor: remove unused tr_stat fields (#3493) 2022-07-20 21:54:41 -05:00
Charles Kerr 88a3149ce4
refactor: add tr_peer.activeReqCount() (#3373)
rename peer_stats.pendingReqs to .activeReqs for consistency
2022-06-28 20:48:39 -05:00
A Cœur 7f01ee52fe
Set torrent file's metainfo for magnets (#3322) 2022-06-21 16:47:57 -05:00
Charles Kerr 25fdb5805c
refactor: use tr_torrent_id_t (#3314)
* refactor: use semantic type tr_torrent_type_t in libtransmission

* refactor: use semantic type tr_torrent_type_t in gtk client

* refactor: use semantic type tr_torrent_type_t in qt client
2022-06-17 10:43:04 -05:00
Charles Kerr d20b77a9ab
refactor: make tr_sessionGetEncryption() const (#3306) 2022-06-15 17:19:24 -05:00
Charles Kerr a28b07b390
Revert "refactor: move tr_torrent callbacks to tr_session (#3003)" (#3104)
This reverts commit 27fbfd8da6.

Fixes #3088.
2022-05-16 13:48:43 -05:00
Dmytro Lytovchenko aa502f9312
Modernize blocklist.cc: Rename, move members inside struct (#2010)
* Modernize blocklist.cc to C++

* Modernize blocklist.cc: Renamed BlocklistFile struct and moved IPv4 range struct inside it

 Modernize bandwidth.cc: Review notes; Promote container of blocklists in session to vec of unique_ptrs
2022-05-15 11:32:22 -05:00
Charles Kerr 27fbfd8da6
refactor: move tr_torrent callbacks to tr_session (#3003)
* refactor: move tr_torrent callbacks to tr_session

* Support tr_sessionSet* (#3044)

Co-authored-by: Antoine Cœur <coeur@gmx.fr>
2022-05-14 10:00:13 -05:00
Antoine Cœur 5d52da8726
Address format conversion warnings in localizations (#3059) 2022-05-14 00:31:24 -05:00
Charles Kerr 5dbe1f4669
refactor: replace tr_fdlimit with tr_open_files (#3016) 2022-04-28 21:35:47 -05:00
Charles Kerr bf655a921d
refactor: use smaller integral types in some structs (#3005) 2022-04-27 20:06:51 -05:00
Charles Kerr 7918113e0b
refactor: partially c++ifiy tr_rpc_server (#2965)
Replace the older C-style API methods to be class methods.
2022-04-22 09:19:20 -05:00
Charles Kerr 32f854a7cf
refactor: add a tr_port safety class (#2952) 2022-04-21 10:58:13 -05:00
Antoine Cœur bdac708762
docs: fix various typos and misspellings (#2955) 2022-04-21 09:28:38 -05:00
Antoine Cœur 4590d172de
meta info piece_size should be maximum UINT32_MAX (#2914) 2022-04-15 00:38:59 -05:00
Charles Kerr 46cc95f72e
refactor: remove unused functions (#2863)
* refactor: annotate nodiscard, constexpr, noexcept methods

* refactor: remove unused tr_blocklistFileExists()

* refactor: remove unused tr_blocklistFileIsEnabled()

* refactor: remove unused tr_ctorGetContents

* refactor: remove unused tr_error_is_set()

* refactor: remove unused tr_handshakeGetAddr()

* refactor: remove unused tr_ctorSetLabels()

* refactor: remove unused tr_http_escape_sha1()

* refactor: remove unused tr_lpdEnabled()

* refactor: remove unused tr_ptrArrayPop()

* refactor: remove unused tr_torrentClearIdleLimitHitCallback()

* refactor: remove unused tr_torrentFindFromHash()

* refactor: remove unused tr_sha1_to_string()

* refactor: remove unused tr_torrents::get()

* refactor: remove unused tr_isEncryptionMode()

* refactor: remove unused tr_isPreallocationMode()

* refactor: remove unused tr_ptrArrayBack()

* refactor: remove unused tr_ptrArrayClear()

* refactor: remove unused tr_torrents::get()

* refactor: remove unused Session::torrentSet()

* refactor: remove unused peer_atom comparison operators

* refactor: remove unused peer_atom::compare()

* refactor: remove unused Qt variantInit(tr_variant*, unsigned)
2022-04-01 21:55:30 -05:00
Charles Kerr fcc1510ecb
refactor: use fmt to build the GTK client's user-visible strings (#2788)
Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-03-21 09:15:48 -05:00
Charles Kerr fa8aaf7631
refactor: remove remaining vararg log messages (#2776) 2022-03-17 17:39:06 -05:00
Charles Kerr 5df252d1e1
fix: calculate ratio as uploaded / sizeWhenDone (#2770) 2022-03-17 13:41:48 -05:00
Charles Kerr af339a15ed
refactor: remove deep logging (#2749)
* refactor: remove "deep logging"
2022-03-09 23:51:14 -06:00
Charles Kerr aa657bb0ca Merge branch 'main' into docs/absorb-the-wiki 2022-02-21 11:43:28 -06:00
Charles Kerr e7d3e205d2 chore: update links to rpc-spec.md 2022-02-21 10:39:58 -06:00
Charles Kerr 3780f90ef5 perf: skip some excess announce list rebuilds 2022-02-21 08:34:59 -06:00
Charles Kerr 8d5c900ee0 refactor: Qt, GTK, web client UI consistency 2022-02-21 08:34:59 -06:00
Stefan Talpalaru 7b377511a9 feat: default public trackers 2022-02-21 08:34:57 -06:00
Charles Kerr 02b6cc76d1
feat: add tr_torrentSetTrackerList(), tr_torrentGetTrackerList() (#2642)
Add a getter/setter for torrent announce URLs as text that can be copied
and pasted: one URL per line, with a blank line between tiers.

C API: tr_torrentGetTrackerList() and tr_torrentSetTrackerList()
RPC APi: `trackerList` in `torrent-get` and `torrent-set`.

This deprecates `trackerAdd`, `trackerRemove`, and `trackerEdit`
from the RPC API.
2022-02-18 11:52:01 -06:00
Charles Kerr 9f9b6cdaa2
feat: run script when done seeding (#2621)
* feat: add seeding-done script to core and rpc

* feat: add seeding-done script to gtk client

* feat: add seeding-done script to qt client

* feat: add seeding-done script to transmission-remote

* refactor: make Qt and GTK client text match

* test: update tests

Co-authored-by: Timothy Nibeaudeau <timothy.nibeaudeau@gmail.com>
2022-02-13 22:07:12 -06:00
Charles Kerr e14c7f38e5
feat: use libpsl (#2575)
Use libpsl to calculate public and private parts of URL hosts.
2022-02-12 11:30:27 -06:00
Charles Kerr eeccc3788f
docs: move rpc-spec document from txt to markdown (#2606) 2022-02-11 10:48:21 -06:00
Charles Kerr 6383e2ff5f
feat: support dscp classes in socket iptos (#2594)
* refactor: Replace ToS with DSCP

IP TOS was superseded by DSCP in RFC 2474.

Co-authored-by: dgcampea <dgcampea@outlook.com>
2022-02-10 15:35:28 -06:00
Charles Kerr 7bdb6f777b
refactor: remove callback from tr_torrentVerify() public API (#2592) 2022-02-09 12:02:59 -06:00
LaserEyess 5565255d85
add labels to torrent-add rpc method (#2539)
This commit adds labels to the torrent-add method, allowing RPC users to
specify labels when adding a torrent. Labels metadata is commonly known
when adding torrents, so this removes the need to send another
torrent-set call to add labels.

Additionally, transmission-remote is updated to handle labels in
torrent-add.

Co-authored-by: LaserEyess <LaserEyess@users.noreply.github.com>
2022-02-03 00:02:30 -06:00
Charles Kerr 878405f862
Revert "fix: sonarcloud (#2558)" (#2562)
This reverts commit 8b9483f7fb.
2022-02-01 11:30:51 -06:00
Charles Kerr 8b9483f7fb
fix: sonarcloud (#2558)
* fix: add const modifier for functions

* fix: many sonarcloud use-init-statement warnings
2022-01-31 22:46:27 -06:00
Charles Kerr df1cca9b57
chore: update copyright years, make notices consistent (#2463) 2022-01-20 12:27:56 -06:00
Charles Kerr 8d75736ad1
fix: empty torrent filename (#2435)
fix torrents readded due to unremoved cfg files.
2022-01-17 23:14:00 -06:00
Charles Kerr bcf5e4636a
fix: calculate seed ratio by torrent size. (#2424)
Previously was calculated by number of bytes downloaded, which caused
edge cases when those two numbers were not the same, e.g. if the user
already had part of the torrent from another source and only downloaded
a small part. When this happened, the ratio could be very large and use
of seedratio would behave in a way that most people would not expect.

Note, the old behavior has been around for a VERY LONG TIME. Even though
this is a bugfix, it does change semantics. I don't think there is any
third-party code that depends on the old behavior but this is arguably
a breaking change.
2022-01-17 17:16:37 -06:00