Commit Graph

756 Commits

Author SHA1 Message Date
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
Mike Gelfand c951848a5b Merge branch '2.9x' 2018-05-01 22:44:51 +03:00
Mike Gelfand 69d9afd75a Adjust CFBundleVersion format to fix Sparkle update check
Set the first version component to be the same as the last Subversion-based
release build version and add two more components (major and minor version
numbers). To allow for nightly build updates this should probably include
another component (e.g. build timestamp), but we're not there yet.
2018-04-17 13:25:49 +03:00
Mike Gelfand 1e8267d68c When building with Xcode, link against 'libcrypto.dylib' instead of 'libcrypto.0.9.8.dylib'
Fixes: #71
2018-01-17 01:14:52 +03:00
Mike Gelfand 3de8b75e59
Merge pull request #387 from DevilDimon/noGrowl
Remove Growl support
2017-11-29 00:59:04 +03:00
Dmitry Serov 9632af7c25 Remove Growl support 2017-11-29 00:38:14 +03:00
Mike Gelfand 30c7c05cbb Refactor completion scripts execution
There're still a few issues here and there, but overall I believe it's now
better than it was before.
2017-11-28 10:03:08 +03:00
Dmitry Serov 68a1960be8 Transition to ARC for QuickLook plugin 2017-08-01 17:26:49 +07:00
Dmitry Serov e88de9677a Remove ARC compiler flags for 3rd-party C libraries 2017-07-31 21:23:19 +07:00
Dmitry Serov bf2f3eac78 Disable ARC for 3rd-party libraries 2017-07-31 21:15:11 +07:00
Dmitry Serov 6e11ee5580 Enable ARC in project settings 2017-07-29 23:42:30 +07:00
Dmitry Serov 845dfe6017 Transition to ARC 2017-07-29 23:14:22 +07:00
Mike Gelfand 6c30359beb Bump miniupnpc version to 2.0.20170509 (take two)
Fix Xcode project to reference changed list of miniupnpc files.
Disable building of upnpc-static executable.

Fixes: #347
2017-07-27 18:29:09 +03:00
Mike Gelfand 18aabdeb06 Introduce peer socket struct to improve readability 2017-06-28 18:50:05 +03:00
Mike Gelfand f701d501a8 Move generic macros to a separate tr-macros.h file 2017-06-18 17:11:20 +03:00
Mike Gelfand 9d29c67484 Add tr-assert.{h,c} to Xcode project 2017-06-08 20:52:05 +03:00
Mike Gelfand fa504fb27f Bump Mac client deployment target to 10.9, fix deprecation errors 2017-02-05 18:41:47 +03:00
Mike Gelfand 788f1e31f1 Update Xcode project format to 8.0 2017-02-05 11:52:39 +03:00
Mike Gelfand dcc9a4308b Fix up creation of third-party include directories symlinks 2017-02-05 10:23:23 +03:00
Mike Gelfand c199eef8ae When building with Xcode, link against 'libcrypto.dylib' instead of 'libcrypto.0.9.8.dylib'
Fix up 'miniupnpc' directory name along the way, using missing 'miniupnp'
was failing the build.

Fixes: #71
2017-01-18 21:56:02 +03:00
Mike Gelfand 87885bdca7 Change Growl and Sparkle frameworks install names to be @rpath-based
Rebuild Growl framework to strip code signature (we resign it anyway, and
changing its install name invalidated the signature); used the same v1.3.1
release so hopefully didn't break anything.
2017-01-11 00:46:23 +03:00
Eitot a035c79da4 Migrate Mac images to asset catalog 2017-01-08 01:54:19 +01:00
Mike Gelfand 505b4f8c4f Merge pull request #11 from JanX2/macosx-misc-1
OS X misc improvements 1
2017-01-07 23:23:07 +03:00
Eitot 4d5531a05d Remove Info.plist from copy phase 2017-01-04 23:30:09 +01:00
Mike Gelfand cb6ce62d0e Adjust Xcode project to use submodules 2017-01-02 23:02:12 +03:00
Mike Gelfand 17fb783c50 Add session-id.{c,h} to autoconf and Xcode builds 2016-09-27 21:36:01 +03:00
Jan Weiß 18ea26319d Set default for indentation to space for entire Xcode project.
This allows correct indentation handling out-of-the-box.
2016-05-15 18:44:31 +02:00
Mike Gelfand f8a7469ba5 #6061: Change Sparkle Update URL to use HTTPS instead of HTTP 2016-02-27 22:54:04 +00:00
Mike Gelfand 96ea2c82fd Check for `iconv()` instead of `iconv_open()`, adjust utils test 2016-02-07 11:54:01 +00:00
Mike Gelfand a086c72b11 Apply most of recommended project changes (OS X) 2016-01-08 10:47:16 +00:00
Mike Gelfand ea48360212 #5663: Rework directory watching in daemon
Implement BSD/Darwin (kqueue) and Windows (ReadDirectoryChanges) mechanisms
for receiving directory change notifications. Use events instead of polling
for changes. Retry file parsing up to 3 times before giving up.

Huge thanks to missionsix for preparing first two versions of the patch.
2016-01-02 14:28:59 +00:00
Mike Gelfand 232778b11a Use default encoding (UTF-8) for all the source files; convert two more .strings files to UTF-8 2015-12-21 17:03:07 +00:00
Mike Gelfand 29165ac00b Remove duplicate and unused languages from OS X client project 2015-12-21 08:58:53 +00:00
Mike Gelfand ccf99c68ac Update all XIBs to latest format (Xcode 7), set deployment target to OS X 10.7 2015-12-21 05:11:40 +00:00
Mike Gelfand 2bab67cb06 Add libcrypto library for Xcode 7 support (complements r14567) 2015-11-03 19:28:05 +00:00
Mike Gelfand 1fd7c46bfa Support compiling Mac client with Xcode 7
Latest Mac OS X SDK (10.11) doesn't include OpenSSL headers, but still
provides the libraries. Bundle our own copy of OpenSSL headers for now
(taken from running 10.10 system).
2015-10-05 00:25:13 +00:00
Mike Gelfand 5b1b22321c #5910: Fix autotools and Xcode build 2015-04-04 18:21:34 +00:00
Mike Gelfand e8d1d8db87 Fix Mac build (make libtransmission depend on libb64) 2015-01-01 22:00:02 +00:00
Mike Gelfand 81c3c00b0f Fix Mac build (add libb64 to Xcode project) 2015-01-01 21:49:21 +00:00
Mike Gelfand 627555f47b #4400, #5462: Fix Mac build by adding new crypto-utils files to Xcode project. 2014-12-05 23:41:09 +00:00
Mitchell Livingston 953780f38e Improve the looks a bit on Yosemite. The app must now be compiled with the 10.10 SDK. 2014-10-16 13:01:17 +00:00
Jordan Lee a59d3392b6 (trunk, libT) #4160: apply mike.dld's patch: 4160-05a-file-fmt.patch 2014-09-21 17:58:22 +00:00
Jordan Lee 60a5c793d9 (trunk, libT) mike.dld's 4160-02a-path.patch: portability wrapper around file paths. 2014-07-03 21:58:39 +00:00
Mitchell Livingston 084273c106 Use built-in __APPLE__ macro instead of SYS_DARWIN and MACOSX 2014-07-03 19:20:12 +00:00
Jordan Lee 92daae473e mike.dld's portability improvements to libtransmission, pt 1 2014-06-23 02:38:53 +00:00
Mitchell Livingston 6503bec3f1 remove Portuguese localization 2014-05-18 19:30:29 +00:00
Mitchell Livingston 6be3af35b3 #5584 Share option in File menu and context menu 2014-01-10 17:50:05 +00:00
Mitchell Livingston 7f3385010b #5533 Turkish localization 2014-01-09 16:35:44 +00:00
Mitchell Livingston ac45921cb4 #5576 Share Button (to iMessage, email, etc) for torrent file 2014-01-09 16:23:54 +00:00
Mitchell Livingston 371cf46151 partial Turkish localization (#5533) 2014-01-09 01:04:08 +00:00
Mitchell Livingston 4ecbb29137 #5304 daemon fails to build on mac 2013-10-27 19:31:36 +00:00
Mitchell Livingston 7a766efe7b add platform-quota.[ch] to the projects file 2013-07-09 04:02:22 +00:00
Mitchell Livingston 794a0c1d80 rearrange the renamer files in the project file 2013-02-08 23:35:56 +00:00
Mitchell Livingston 94a329b38a update Mac code for logging changes in r13868 2013-01-26 19:17:58 +00:00
Mitchell Livingston 9236571f1c #1220 Initial Mac support for changing file and folder names. Not fully complete. 2013-01-22 00:09:48 +00:00
Mitchell Livingston bc574a559a #5223 Use VDKQueue for watching for torrent files 2013-01-19 05:03:00 +00:00
Mitchell Livingston b5cc6b5a4f #5221 Switch to DWARF with dSYM File (STABS debug information format prevents source-level debuging in LLDB) 2013-01-14 00:23:45 +00:00
Mitchell Livingston 68d68d9420 add new quark files to the project file, and update the libtransmission initialization constants 2012-12-23 03:17:18 +00:00
Mitchell Livingston 1dc8c47059 mac build compiles with r13667 2012-12-14 23:28:49 +00:00
Mitchell Livingston 9fd56f6c76 update project file to work with new json files 2012-11-11 07:14:57 +00:00
Mitchell Livingston 645ffe9717 perform some surgery to remove Chinese from the Xcode project 2012-09-22 16:28:56 +00:00