Commit Graph

5977 Commits

Author SHA1 Message Date
Julien 8ac323d5d6
chore: removed copyright timespans in headers (#4850) 2023-11-01 16:11:11 -05:00
sfan5 aaed2eb26c
feat: sanitize torrent filenames depending on current OS (#3823)
Instead of applying the limitations of the least common denominator (Windows) everywhere.
2023-11-01 15:27:04 -05:00
Charles Kerr e54b17d92e
refactor: blocklists (#6189) 2023-10-31 19:20:01 -04:00
Charles Kerr f0e9f90782
refactor: move tr_session::getAllTorrents to tr_torrents (#6179) 2023-10-30 16:38:02 -04:00
Dzmitry Neviadomski c697d95ad3
fix: crash after nullptr dereference in rpcimpl (#6177) 2023-10-30 13:30:10 -04:00
Charles Kerr e27b05bcec
refactor: make class methods private (#6181) 2023-10-30 02:32:29 -04:00
Yat Ho d059669c0e
fix: formatting cmdline help message (#6174) 2023-10-29 15:41:39 -04:00
Yat Ho d224985ef8
fixup! perf: cut down excess copying when downloading (#5907) (#6169) 2023-10-27 00:19:24 -04:00
Charles Kerr 72d2823851
refactor: remove tr_torrentTotalSize() (#6166)
this interim function should have been removed when tr_torrentView() was introduced
2023-10-25 16:37:09 -04:00
Charles Kerr 165cf169e6
refactor: extract the lambda method in tr_variant::Map::find() (#6161)
experimental change for msvc 19.37 ftbfs
2023-10-25 15:36:28 -04:00
Charles Kerr 901de536a3
fix: in RPC, default to sort torrents by id (#5604)
When getting all torrents in a batch over RPC, the results are sorted by
info-dict hash. Prior to 4.0.0, they were sorted by ID. This change broke
some peoples' workflows.

I'm OK with breaking workflows if it's necessary to improve the program,
but this was an unintentional side-effect and I don't see any inherent
benefit to either sort order. So this PR restores the 3.00 sort order.

https://xkcd.com/1172/
2023-10-25 13:42:14 -04:00
Yat Ho 5a6f0a5623
fixup! refactor: re-organise net.h member functions (#5878) (#5933)
* fix: check if address is valid in `tr_address::is_any()`

* refactor: add static implementation of `tr_address::is_valid()`
2023-10-25 11:53:46 -04:00
Yat Ho 6e7fdef721
perf: cut down excess copying when downloading (#5907)
* refactor: directly copy from socket to incoming payload

* refactor: directly process the incoming field

There is no need to copy the payload to a new buffer before processing.

`process_peer_message()` isn't going to return until it's done, and nothing else is going to mess with the incoming field while inside `process_peer_message()`.

* refactor: remove while loop

* add assert
2023-10-25 09:51:36 -04:00
Charles Kerr 237223aeaf
refactor: prefer std::set over QSet (#5703)
* refactor: use std::set instead of QSet in WatchDir.cc

* refactor: use std::set instead of QSet in FileTreeView.cc

* refactor: use std::set instead of QSet in ColumnResizer.cc

* refactor: use std::set instead of QSet in Prefs.cc

* chore: fix rebase error that changed libsmall snapshot

* refactor: more replace QSet with std::set
2023-10-24 21:14:37 -04:00
Charles Kerr 69b293a793
refactor: minor decoupling in peer-mgr (#6155)
* refactor: minor decoupling in peer-mgr

Pass a tr_torrents& and TimerMaker& into the tr_peerMgr and HandshakeMediator
constructors so they can be used directly instead of via tr_session.

No functional changes.

* refactor: in HandshakeMediator, make the session reference const
2023-10-24 15:24:52 -04:00
Charles Kerr bbc3ce039f
refactor: remove quark support from tr_variant (#6159) 2023-10-24 14:49:23 -04:00
Charles Kerr eb58996c9f
chore: remove unused tr_announce_list::announce_to_scrape(tr_quark) (#6157)
* chore: remove unused tr_announce_list::announce_to_scrape(tr_quark)

* fixup! chore: remove unused tr_announce_list::announce_to_scrape(tr_quark)

fix test oops
2023-10-24 10:58:01 -04:00
Yat Ho 6d958bd5fc
feat: do separate IPv4 and IPv6 port checks in WebUI (#5953)
* feat: add `ipProtocol` argument to `port-test` rpc method

* chore: update rpc-spec.md

* feat: split port check UI to IPv4 and IPv6 in webUI

* fix: default `open` to false if cannot get response

* chore: minor docs wording tweak

* chore: make clang-tidy happy

* chore: RPC doc tweaks

* fix: bad merge

* chore: review feedback

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: match quark enum with parameter case

* refactor: use descriptive strings for `ipProtocol`

* chore: update docs

* fixup! refactor: use descriptive strings for `ipProtocol`

* fixup! chore: update docs

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-10-24 09:27:28 -04:00
Charles Kerr 735639c5c7
refactor: make tr_torrent::labels_ private (#6153) 2023-10-23 18:11:28 -04:00
Charles Kerr c0e5e3a368
refactor: reduce coupling between tr_session and tr_peerMgr (#6151) 2023-10-23 11:34:30 -04:00
Charles Kerr 682e4f2c2b
refactor: make tr_torrent::any_date_ private (#6148) 2023-10-21 23:23:08 -04:00
Charles Kerr 8f7330523c
chore: remove unused progress arg from tr_torrentSetLocation() (#6147) 2023-10-21 22:33:41 -04:00
Yat Ho 2130eb941a
refactor: drop jsonsl in favour of RapidJSON (#6138) 2023-10-21 14:00:12 -05:00
Charles Kerr 0457dcb6a8
refactor: make tr_torrent::files_wanted_ private (#6146) 2023-10-21 13:21:05 -05:00
Charles Kerr 8c1291ce8a
refactor: make tr_torrent::unique_id_ private (#6145) 2023-10-20 21:23:14 -05:00
Charles Kerr 9e5c528056
refactor: add tr_torrent::stat() (#6143) 2023-10-20 20:35:59 -05:00
Yat Ho 88fe76781c
perf: connectable pool housekeeping (#6111) 2023-10-19 13:05:19 -05:00
Charles Kerr 4bdb3066d8
refactor: decouple tr_verify_worker from tr_torrent (#6123) 2023-10-19 08:39:34 -05:00
Yat Ho c70c49e87b
fix: encode `ip` in network byte order for udp announce (#6126) 2023-10-18 09:46:57 -05:00
Charles Kerr 0c3f65e1c6
fix: FTBFS on FreeBSD with clang 14 (#6110) 2023-10-16 19:39:14 -05:00
Yat Ho 0259edbaf3
fix: json string serializer improperly escaping characters (#6005)
* feat: escape json string according to RFC8259

* fix: do not append newline when json serde is in compact mode

* fix: json tests

1. Use the same locale settings as the apps
2. Added additional test case for a string that are known to be prone to locale issues
3. Removed test for escaping non-BMP characters to UTF-16 escape sequences

* chore: add more test cases to `JSONTest.testUtf8`

* chore: order cases in the same order as RFC8259
2023-10-16 19:36:37 -05:00
Yat Ho 6cec60f1fb
refactor: store outgoing handshake in `tr_peer_info` objects (#6103) 2023-10-14 12:58:15 -05:00
Yat Ho 43aff088d8
fix: only consider piece data in bandwidth limit (#6082)
* fix: only consider piece data in bandwidth limit

* refactor: remove unused `tr_bandwidth::clamp()` signature
2023-10-09 08:49:49 -05:00
Charles Kerr db96771c80
refactor: add tr_torrent::Error helper class (#6077) 2023-10-08 21:33:34 -05:00
Yat Ho 0c52b710ad
feat: add option to force verify torrent in WebUI (#5981) 2023-10-06 22:52:59 -05:00
Yat Ho 2c97567370
chore: minor housekeeping for bandwidth code (#6080) 2023-10-06 18:30:04 -05:00
Charles Kerr ce39b01dd2
perf: reduce unnecessary size overhead in tr_torrent struct (#6073) 2023-10-04 21:38:14 -05:00
Yat Ho c6236c7bee
fix: reconstruct `utp_core_` when toggling utp (#6075) 2023-10-04 20:33:18 -05:00
Charles Kerr 3f7340502f
refactor: add a SimpleSmoothedSpeed helper class (#6072) 2023-10-04 17:40:46 -05:00
Yat Ho 93e8bf7330
fixup! refactor: make tr_torrent idle fields private (#6070) (#6074)
Thanks!
2023-10-04 16:33:04 -05:00
Charles Kerr 68f3c89e3c
refactor: make tr_torrent idle fields private (#6070) 2023-10-03 20:18:55 -05:00
Charles Kerr 32a62d85ea
refactor: more tr_variant API (#6057) 2023-10-02 16:18:35 -05:00
Charles Kerr 917c00e477
refactor: remove tr_torrentStatCached() (#6066) 2023-10-02 14:07:28 -05:00
Yat Ho 5808f72f50
fix: assertion failed: port_empty in `tr_swarm::remove_peer()` (#6062) 2023-10-02 11:57:48 -05:00
Yat Ho 170f589b64
fixup! refactor: remove redundant code when adding announce lists to metainfo (#6050) (#6061) 2023-10-02 10:18:38 -05:00
Yat Ho ee4daa059d
feat: check if files are missing after setting location (#5978) 2023-10-01 19:21:18 -05:00
Cœur 1722f00777
chore: apply clang-format version 17.0.1 (#6054) 2023-10-01 18:45:52 -05:00
Yat Ho cfa26d0da8
chore: more specific peer error log (#6029) 2023-10-01 10:43:17 -05:00
Charles Kerr 55da783e8f
refactor: remove redundant code when adding announce lists to metainfo (#6050) 2023-09-30 07:31:43 -05:00
Yat Ho 82a9aa6cf0
fix: correct log output (#6048) 2023-09-29 21:37:14 -05:00