Commit Graph

816 Commits

Author SHA1 Message Date
A Cœur 64b5fde8b2
fixup: silence "empty expression statement has no effect" warning (#4074) 2022-11-02 09:04:22 -05:00
Charles Kerr 611d36ac84
refactor: decouple session settings from the session class (#4053) 2022-11-01 19:32:26 -05:00
A Cœur ab825a4cea
Fix tr-buffer.h has same ID as tr-utp.h (#4032) 2022-10-25 14:09:11 -05:00
Charles Kerr 450f1dcadc
refactor: extract `tr_buffer` class from `tr_peerIo` (#3986) 2022-10-19 11:42:08 -05:00
Charles Kerr c8e652c820
refactor: add dns interface class (#3977) 2022-10-17 14:41:42 -05:00
Cœur 7601c1f7b1 Fix red link in Xcode project 2022-10-13 02:44:06 +08:00
A Cœur 4f957657d1
Upgrade Xcode Project Settings (#3940) 2022-10-11 16:51:45 -05:00
Mitchell Livingston afdae24995 Only include public_html, rather than the whole web directory, in the Mac client 2022-10-06 22:33:34 -04: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
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 5bcbb7e34b
refactor: aggregate arc4 into libtransmission (#3684) 2022-08-20 13:41:40 -05:00
Charles Kerr b49cccbd3e
refactor: add timer class (#3603)
Wraps around evtimer so that some of the codebase can use libevent without coupling to it.
2022-08-08 17:53:20 -05:00
SweetPPro 8724c3dc1a
macOS internationalization of xibs (#3409) 2022-07-17 18:04:32 -05:00
Charles Kerr 2bcab6be7e
refactor: remove tr_dh code (#3443)
Refactor the MSE handshake Diffie-Hellman key code.
2022-07-14 19:54:10 -05:00
Charles Kerr 745adf8332
Update libutp to 3.4+ (TRAC-5888) (#3416)
Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-07-08 10:13:22 -05:00
Dmitry Serov 7e278c453a
[macOS] Optimise framework imports (#3323) 2022-06-28 19:15:52 -05:00
SweetPPro 849a36a30d
macOS fix Toolbar show/hide on macOS Mojave (#3327) 2022-06-24 00:26:36 -05:00
FX Coudert e0c593741c
Raise minimum supported target to macOS 10.13 (High Sierra) (#3310) 2022-06-18 09:26:45 -05:00
SweetPPro c6b49e99d8
macOS revert fullscreen changes (#3304)
* macOS remove NSWindow subclass

as discussed in #3297
2022-06-16 12:55:33 -05:00
SweetPPro 037f1bf403
macOS remove NSWindow subclass (#3303) 2022-06-16 09:29:50 -05:00
Dzmitry Neviadomski 922ae556d7
Roll libdeflate v1.12. (#3298)
* Roll libdeflate v1.12.

* Update Xcode Project for libdeflate v1.12
2022-06-14 21:16:01 -05:00
SweetPPro c3cd9cffad
re-add macOS Fullscreen support (#3261)
* re-add macOS Fullscreen support

re added Full Screen support for macOS. Also refactored window methods in Controller.mm and moved to their own category - ControllerWindowMethods.mm

This has currently only been tested on macOS Monterey, and should be good on earlier versions - but perhaps needs testing on earlier versions of macOS.

fixes #3231 #3234
2022-06-12 19:54:52 -05:00
Dzmitry Neviadomski 3fe2ed893f
[macOS] Ignore warnings while building third-party projects in Xcode. (#3267)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-06-12 12:49:44 -05:00
Dzmitry Neviadomski be092ebea6
[macOS] Fix Xcode warnings for non-incremental build script phases. (#3266) 2022-06-12 11:24:30 -05:00
Charles Kerr 34cb56b2af
refactor: remove unused tr_ptrArray class (#3262)
* refactor: remove unused tr_ptrArray class

* fixup! build: add sanitizer CI runs when libtransmission-test changes (#3260)
2022-06-11 21:45:00 -05:00
Charles Kerr 12592e20d6
build: remove unused function checks (#3233)
* build: remove unused -DHAVE_ASPRINTF from xcode build

* build: remove unused -DHAVE_ZLIB from cmake and xcode

we use libdeflate instead

* build: remove unused -DHAVE_LIBGEN from xcode
2022-06-08 13:35:07 -05:00
SweetPPro 8d61f07930
fix: missing source file in CMake macOS build (#3208)
* Update CMakeLists.txt

correctly add new files to xcode project
2022-06-05 13:33:18 -05:00
A Cœur 4906349e3a
Make Sparkle optional to allow running Transmission without Apple Developer Program (#3050)
* Make Sparkle optional to allow building without Apple Developer Program

* Display a nice alert for developers clicking "checkForUpdates" when app isn't signed for Sparkle

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-06-03 12:47:33 -05:00
SweetPPro df657e9a04
Updated macOS segmented control alignment and popup button style (#3156)
* updated macOS group popup button alignment

popup button alignment enhancements described in the following issue: https://github.com/transmission/transmission/issues/3143

* updated macOS segmented controls in Preferences window

as described in the following issue: https://github.com/transmission/transmission/issues/3143
2022-06-02 19:05:15 -05:00
Charles Kerr 19db28c04d
perf: faster detection of invalid filenames (#3126)
* refactor: move file_info into tr_torrent_files

* chore: rename files-test as torrent-files-test.cc

* test: add tests for tr_torrent_files::isSubpathPortable()
2022-05-23 17:53:26 -05:00
A Cœur 2e25370cc5
Fix QuickLook (#3001)
* Fix QuickLook symbol not found; add file sort and filesize
2022-05-19 23:07:17 -05:00
Charles Kerr 2293f4336a
perf: use fast_float to parse floating-point numbers (#3092) 2022-05-16 00:06:17 -05:00
Antoine Cœur a57d265968
Set recommended CODE_SIGN_IDENTITY and PRODUCT_BUNDLE_IDENTIFIER (#3043) 2022-05-01 16:55:09 -05:00
Antoine Cœur 7eecdca68e
clang-format version 12.0.1 + 14.0.3 (#3027) 2022-04-30 12:49:52 -05:00
Charles Kerr 5dbe1f4669
refactor: replace tr_fdlimit with tr_open_files (#3016) 2022-04-28 21:35:47 -05:00
Antoine Cœur b734b17a4b
adding missing transmission targets (#2976) 2022-04-25 08:12:21 -05:00
Antoine Cœur 7f9264940e
Compatibility to build on the last macOS 32 bit system with its last compatible Xcode (#2844)
* Compatibility to build on the last macOS 32 bit system with its last compatible Xcode

* Code review: Compatibility declarations

* compatibility with `make`

* Code review: headers

* Avoiding dummy NSImageSymbolConfiguration implementation

* clang-format

* Don't force-include compat header

* Remove compat header from pch header

Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-04-24 21:34:30 +01:00
Charles Kerr 2866638e1b
refactor: add tr_torrent_files::move() and remove() (#2919) 2022-04-15 18:39:04 -05:00
Antoine Cœur 4590d172de
meta info piece_size should be maximum UINT32_MAX (#2914) 2022-04-15 00:38:59 -05:00
Antoine Cœur 6266533546
Addressing read links in the Xcode project (#2903) 2022-04-14 09:24:10 -05:00
Charles Kerr 4a65956cc9
refactor: extract some file management into tr_files class (#2906) 2022-04-12 10:00:02 -05:00
Charles Kerr 9d141ee2b1
refactor: add fmt::formatters (#2829)
* refactor: add fmt::formatters
2022-03-27 21:55:30 -05:00
Charles Kerr 6e8f9f3ff0
feat: add tr_strbuf (#2810)
* feat: add tr_strbuf class for building tmp strings

Based on fmt::basic_memory_buf, this is a growable string buffer that
has an initial size that's large enough to build most filenames or URLs
without needing heap allocations.

Adds a couple of extra helpers such as a `c_str()` method to make dealing
with old zero-terminated string APIs easier.
2022-03-24 16:41:29 -05:00
Charles Kerr a942c67199
refactor: use fmt (#2758)
* deps: use fmt (8.1.1 tag) to build log strings

Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-03-13 23:43:35 -05:00
Charles Kerr 2bd42f8225
fixup: macos log error (#2764)
* fix: assertion failure in MessageWindowController

* feat: update messagwindow xib to new log levels
2022-03-12 11:42:43 -06:00
Charles Kerr 60ef1abadf
refactor: tr_torrents (#2722)
* refactor: add tr_torrents container
2022-03-01 15:06:29 -08:00
Charles Kerr cfb92c47f0
feat: warn when creating torrents with nonportable filenames (#2695)
* feat: check new torrents for nonportable filenames

* fix: parse torrents even if they have nonportable filenames in the info dict's 'file' string
2022-02-23 17:38:07 -06:00
Dmitry Serov 54d1a02e92
Use properties instead of ivars (#2453) 2022-02-22 10:04:20 -06:00
Mitchell Livingston d2ee48d05d Remove the accent color
The app will now use the default system blue when no system-level accent color is set.
2022-02-21 09:38:22 -05:00
Charles Kerr 75e111e581
build: use -DHAVE_FLOCK in the macOS Xcode build (#2629)
Fixes #2555
2022-02-15 01:00:43 -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 7bc668680e
chore: remove unused function tr_strcasestr() (#2552) 2022-01-31 15:59:14 -06:00
Charles Kerr 5efec26a3b
refactor: SAX-like benc parser pt. 1 (#2490)
* refactor: add SAX-like benc parser

This is the first part of a series of PRs whose end goal is to avoid
the overhead of tr_variant when parsing bencoded data, e.g. when
parsing .torrent files on startup or when parsing announce/scrape
tracker responses.

This PR introduces a SAX-like benc parser, reimplements variant-benc
to use the SAX benc parser (so that we don't have two benc parsers),
and updates the benc + variant tests.
2022-01-24 00:30:00 -06:00
FX Coudert a2e30235c4
Make macOS crash reports provide more information (#2471)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-01-23 18:10:06 -06:00
Charles Kerr d8d765c595
refactor: use libdeflate instead of zlib's deflate() (#2405)
Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-01-17 10:20:12 -06:00
Charles Kerr db23ca4c6b
refactor: replace tr_info with tr_torrent_metainfo (#2397)
* refactor: replace tr_info with tr_torrent_metafo
2022-01-15 13:33:57 -06:00
Charles Kerr 7c87cb36eb
refactor: tr_torrent_metainfo (#2340)
* refactor: add tr_torrent_metainfo class

Can be used for parsing bencoded .torrent data without instantiating
a tr_torrent. This will be used in all the places where client code
needs to test a .torrent file for validity / to add a preview window
before adding the torrent.
2021-12-25 15:21:13 -06:00
Charles Kerr dd1379b0b6
refactor: add tr_interned_string (#2332) 2021-12-23 11:16:05 -06:00
Charles Kerr 656df477f2
refactor: add tr_announce_list (#2308)
* refactor: add tr_announce_list (#2308)
2021-12-14 14:59:40 -06:00
Dzmitry Neviadomski c38ee22f7f [macOS] Update Info window.
Use SF Symbols on macOS 11+

Use NSSegmentedControl instead of custom view.

Add NSImage extension to fallback loading from
assets on macOS 10.15 and older.

Also should fix sizing issues when changing pane from Options
to Files.

Fixes #2247
2021-12-12 08:24:16 +03:00
Charles Kerr bbe49639d6
refactor: use cpputf for utf8 validation and conversion (#2251)
* refactor: use cpputf for utf8 validation and conversion
2021-11-30 15:13:56 -06:00
Charles Kerr 35fe175f2a
refactor: add file-piece-map (#2246)
* refactor: add file-piece-map

* refactor: use tr_file_priorities

* refactor: use tr_files_wanted
2021-11-28 19:12:54 -06:00
Charles Kerr 843e486d2a
refactor: tr_block_info class (#2210)
* refactor: add tr_block_info with tests
2021-11-24 08:48:52 -06:00
Charles Kerr 073c6af1d6
refactor: swarm (#2103)
* refactor: encapsulate request tracking in a class

Introduces a new class to peer-mgr, `ClientRequests`, which tracks what
active requests we've got pending: which blocks, when the requests were
sent, and who they were sent to.

This shouldn't change peer-mgr behavior. Its goal is to carve out some
of peer-mgr's data structures and encapsulte them behind an API that's
simpler to understand.

* refactor: move ActiveRequests to its own file

* perf: avoid duplicate call to tr_cpMissingBlocksInPiece
2021-11-19 12:37:38 -06:00
Dzmitry Neviadomski b573d0c77f
Fix building with Xcode 13.1 and macOS 12.0 SDK. (#2141)
Fixes #2140
2021-11-13 22:22:49 +03:00
Charles Kerr 7693ef69bf
refactor: magnet metainfo (#2124)
* refactor: magnet-metainfo
2021-11-09 20:42:18 -06:00
Charles Kerr d8b57fe4dc
refactor: web_utils (#2121)
* chore: move web utils from web, utils to web-utils
2021-11-08 21:30:03 -06:00
C.W. Betts 62c92227e3
macOS: use SDK's libCurl. (#1542)
* Use the SDK's provided libcurl instead of relying on an outdated stub library.

* Quiet a linker warning.

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2021-10-24 22:27:23 +03:00
Mike Gelfand 5edbcb3740
Add CommonCrypto-based crypto utils implementation (#2032)
* Add CommonCrypto-based crypto utils implementation

Ported and adapted from an old (circa 2014-2015) branch of mine.

DH helpers are based on CCBigNum since CCDH doesn't provide acceptable error
reporting, and SecDH interface is a bit weird and limiting. Given that all
mentioned APIs are private, it doesn't seem to matter which one we're using as
any of them could be changed/removed by Apple at any point.

* Switch Xcode project to CommonCrypto backend
2021-10-24 21:19:57 +03: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 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 7d2f65455c
refactor: remove unused tr_list code (#1849) 2021-09-27 17:57:20 -05:00
Charles Kerr 6c77fa92ce
Port transmission-cli to C++ (#1831)
* move transmission-cli to C++
2021-09-24 09:38:09 -05:00
Mike Gelfand b7ba261359
Port macOS client to C++ (#1830)
* Rename all .m (Obj-C) files to .mm (Obj-C++)

* Fix build in Obj-C++ mode

* Fix Xcode build
2021-09-24 07:56:57 -05:00
Charles Kerr 1ee88c019f
refactor: port daemon and utils to C++ (#1825)
* refactor: compile daemon/ and utils/ as C++

Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2021-09-21 18:03:39 -05:00
Charles Kerr fc0ba38bc9
refactor: tr_quickfindFirstK --> std::partial_sort (#1794)
* refactor: tr_quickfindFirstK --> std::partial_sort

Remove `tr_quickfindFirstK()` and use `std::partial_sort()` instead.

Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2021-09-15 09:32:07 -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
Mike Gelfand a459e5e11b
Switch to a standalone ARC4 implementation (#1788)
* Switch to a standalone ARC4 implementation

This frees us from expecting it being provided by one of the crypto
libraries we support, all of which deprecated and/or removed it at this
point.

Fixes: #1103
Fixes: #1777

* Suppress lgtm warnings about RC4 being weak (we don't care)
2021-09-12 06:47:29 +03:00
Dmitry Serov af3a4d4557
Modern Objective-C syntax (#509)
* Update enabled complier warnings

* Convert to Modern Objective-C syntax using Xcode's tool

* Convert to modern objc syntax manually, fix some PR issues

* Remove unnecessary parentheses

* Use property syntax for all custom properties

* Use property syntax for all system properties

* Fix erroneously autoreleased values

* Revert VDKQueue to old objc syntax

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
Co-authored-by: Mitch Livingston <livings124@mac.com>
2021-08-07 10:27:56 +03:00
Dzmitry Neviadomski 59cf023e57
Update libevent to 2.1.12-stable. (#1588)
* Update libevent to 2.1.12-stable.

Fixes `kq_init: detected broken kqueue; not using.: Undefined error: 0`
message on start on macOS.

* Do not build libevent samples.

* Explicitly set library type to static on MSVC for libevent.

Co-authored-by: Mitch Livingston <livings124@mac.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-05-20 11:36:12 -05:00
Mitchell Livingston 7edd656536 Update app icon from icns to pngs in the asset catalog 2021-03-29 22:07:55 -04:00
Mitchell Livingston 55e883318d Set an app accent color on macOS 11 2020-11-17 23:46:03 -05:00
Charles Kerr f59118d1fe
feat: add torrent-get 'primary-mime-type' to RPC. (#1464)
* feat: add torrent-get 'primary-mime-type' to RPC.

This is a cheap way for RPC clients to know what type of content is in a
torrent. This info can be used to display the torrent, e.g. by using an
icon that corresponds to the mime type.

* use size_t for content byte count

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>

* explicit boolean expressions

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>

* use uint64_t for content byte counts

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>

* avoid unnecessary logic branches

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>

* explicit cast

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>

* refactor: add an autogenerated mime-type.h header

* chore: maybe fix the win32 FTBFS

* chore: add mime-types.[ch] to xcode

* Squashed commit of the following:

commit 4c7153fa48
Author: Mike Gelfand <mikedld@users.noreply.github.com>
Date:   Tue Oct 13 03:15:19 2020 +0300

    Remove autotools-based build system (#1465)

    * Support .git files (e.g. for worktrees, submodules)
    * Fix symlinks in source tarball, switch to TXZ, adjust non-release name
    * Remove autotools stuff

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2020-10-13 10:33:56 -05:00
Mitch Livingston 494589efa8
Merge branch 'master' into patch-1 2020-01-03 00:15:03 -05:00
Mitchell Livingston 1a9f5601c3 Set Sparkle framework as "Embed and Code" 2019-12-23 22:21:13 -05:00
C.W. Betts 0a67db48bc Merge branch 'master' into patch-1 2019-07-15 12:24:32 -06:00
Mike Gelfand f3968b7708 Load CA certs from system store on Windows / OpenSSL
Fixes: #446
2019-06-23 11:59:53 +03:00
C.W. Betts 77016edadd Xcode: Update/fix framework references. 2019-06-15 12:19:34 -06:00
C.W. Betts 2d4a53f2df Xcode: Fix development region. 2019-06-15 12:12:55 -06:00
C.W. Betts 3b1780982a Xcode: Add encoding info to strings files. 2019-06-15 09:37:14 -06:00
C.W. Betts 04c6885232 Xcode: Fix localization paths. 2019-06-15 09:23:17 -06:00
C.W. Betts 8911c9a839 Fix Xcode groups:
Make them actually point to the folders.
2019-06-15 09:15:10 -06:00
LaserEyess 750589101a Parse session-id header case-insensitively (#765)
RFC 2616 defines headers as case-insensitive, so if rpc is behind a
reverse proxy that lowers the case of headers, transmission will not
parse them correctly.

A new wrapper function, `tr_strcasestr` is added to
libtransmission/utils.c to allow for comparisons of headers case
insensitively, and checks in cmake and autogen are included.
2019-03-17 17:37:52 +03:00
Antoine Cœur 34324a2d80 Fix QuickLookPlugin reference path to be relative to group 2019-02-03 10:49:06 +08:00
Mitchell Livingston 0cbf62411b Enable hardened runtime 2018-12-21 20:15:46 -05:00
Mitchell Livingston 47cbb898f8 Update the info tab on appearance change 2018-12-21 17:37:17 -05:00
Mitchell Livingston d5dc5d1a24 Update project.pbxproj
Bump minimum version to 10.10
2018-12-21 16:20:13 -05:00
Mike Gelfand 4671276450 Move transmission-remote to utils (Xcode) 2018-11-13 01:38:43 +03:00
Mike Gelfand 466b71a25f Fixup previous commit for transmission-remote 2018-09-30 13:52:04 +03:00
Mike Gelfand 8863e88570 Fix build with Xcode 10
For some reason, Mac client is the only project that references
libtransmission files as if they were a part of its own project, and
inconsistently so. Make the include/import style uniform an in line with
other projects.

Adjust Mac client include directory settings a bit along the way.
2018-09-30 13:37:30 +03:00