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>
* 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: #1103Fixes: #1777
* Suppress lgtm warnings about RC4 being weak (we don't care)
* Add in-kernel copying support for Linux (sendfile64(2), copy_file_range(2)), FreeBSD 13 (copy_file_range(2)), MacOS (copyfile(2)), and Windows (CopyFileExA).
* Fix macro name USE_COPY_FILE_RANGE.
* Minor bugfixes for userspace fallback.
* Fix linux sendfile64 bugs.
* Remove some overzealous asserts.
* Allow transmission-test-copy to take an optional argument for an external reference file.
* Fix return value error of tr_sys_path_copy.
* Use COPYFILE_ALL for Macs without COPYFILE_CLONE.
* Add in-kernel file copying for several platforms.
Numerous operating systems now have support for copying files directly in the
kernel, which is generally more efficient than copying in a userspace read(2)/
write(2) loop. (This becomes particularly relevant for 4th gen PCI-E storage,
which approaches the latency of DRAM.) For Linux I use sendfile64(2), and, for
later kernels, copy_file_range(2). FreeBSD 13 will also support
copy_file_range(2). MacOS has copyfile(2), and Windows has CopyFileExA.
Operating systems lacking such a syscall continue to use the existing
read(2)/write(2) loop.
* Appease uncrustify.
* Appease uncrustify.
* copy-test: generate random content at run time.
* copy-test: Stylistic changes and more check()s.
* copy-test: files_are_identical should follow test idioms
* tr_sys_path_copy: numerous tweaks as requested by review.
* s/old file/source file; s/new file/destination file.
* tr_sys_path_copy: handle win32 wide characters in paths.
* Uncrustify.
* test-copy: Use non-string create_file_with_contents.
* tr_sys_path_copy: numerous fixes.
Per review: generate test file content at runtime; tidy use of check();
fix style; re-measure file sizes in the copy; define a macro when the
system does not provide it; use Unicode APIs on Windows; and fix
documentation.
* Updated as per comments.
* Rebase kernel-copy changes onto 3.0 with gtest.
* Undo irrelevant comment change.
* Fix syntax error.
* Use tr_malloc() instead of tr_valloc().
* Use EXPECT instead of TR_ASSERT in gtest.
* Add error handling.
* Acceptable coding style has changed again.
Now it's camelCase. Also use nullptr instead of NULL, etc.
* Fix east/west const.
Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
* 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>
* refactor: remove unnecessary func tr_valloc()
We're only using it in a handful of places, and none of them need the
kind of alignment that posix_memalign() provide. So we can drop a few
dozen lines by removing the portability wrapper.
Give the web client a major overhaul.
User-visible highlights include:
* Mobile is now fully supported.
* Added fullscreen support on mobile.
* Better support for dark mode.
* Added mime icons to the torrent list.
* Improved theme consistency across the app.
Maintainer highlights include:
* Updated code to use ES6 APIs.
* No longer uses jQuery UI.
* No longer uses jQuery.
* Use Webpack to bundle the Javascript, CSS, and assets together -- the entire bundle size is now 68K gzipped.
* Added eslint / prettier / stylelint tooling.
* Uses torrent-get's 'table' mode for more efficient RPC calls.
* Support .git files (e.g. for worktrees, submodules)
* Fix symlinks in source tarball, switch to TXZ, adjust non-release name
* Remove autotools stuff
MSVC does not support GNU-style compiler flags, and vice versa. Not only
does it make no sense to test for those flags, with MSVC it also takes
considerably longer to do so.
The only flag that MSVC does support is -Wall (/Wall), but since it's
equivalent to Clang's -Weverything and thus issues lots of warnings
nobody usually cares about, including from system header files, it's
preferred to use /W4.
Some compilers issue additional CLI-level warning, that cannot be
suppressed, when passed flags that are irrelevant for a particular
invocation. Temporarily treat warnings as errors when testing flags
support so that those warnings lead to flags being excluded.
When built with CMake, CURL installation includes configuration package
that could be used instead of CMake-bundled find module. The former
doesn't define CURL_INCLUDE_DIRS and CURL_LIBRARIES variables, but only
imported targets.
* Switch to new libcurl's polling interface
* Drop unused includes
* Use NOFILE limit value defined by operating system
* Avoid tight loops, ensure blocking for a small timeout
When there are no file descriptors to wait for, select() would work the
same as sleep(). But curl_multi_wait() returns immediately in this case,
so we need to add explicit wait to avoid tight loops.
Documentation: https://curl.haxx.se/libcurl/c/curl_multi_timeout.html
Discussion: https://curl.haxx.se/mail/lib-2018-03/0074.html
* Bump libcurl minimum version to 7.28.0
* chore: fix markdown headers in NEWS.md
* chore: turn closed pulls/issues into links
* chore: linkify the release headers
* chore: fill in the 3.00 release date
* chore: use 'NEWS.md' in build scripts
* chore: tweak date format to YYYY-MM-DD
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.
Store full revision hash in REVISION file. Write fixes 10 chars of revision
hash to version.h. Use `#pragma once` in version.h. Support getting revision
from TeamCity environment variable (similar to Jenkins).
All the compilers should provide the header file by now. Remove `tr_isBool`
sanity checks along the way as compiler should guarantee that bool (_Bool)
values are 0 or 1 and nothing else.
Store full revision hash in REVISION file. Write fixes 10 chars of revision
hash to version.h. Use `#pragma once` in version.h. Support getting revision
from TeamCity environment variable (similar to Jenkins).