From 47ebb3f63a2f8983f9858bfbec6b72c42588a388 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 1 Jan 2023 16:24:12 -0600 Subject: [PATCH] refactor: remove obsolete lightweight build option (#4509) --- CMakeLists.txt | 3 --- docs/Editing-Configuration-Files.md | 4 ++-- libtransmission/CMakeLists.txt | 1 - libtransmission/crypto-utils-openssl.cc | 8 +------- libtransmission/utils.h | 2 +- 5 files changed, 4 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 493505976..3000306a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,9 +49,6 @@ option(ENABLE_WEB "Build Web client" OFF) option(ENABLE_UTILS "Build utils (create, edit, show)" ON) option(ENABLE_CLI "Build command-line client" OFF) option(ENABLE_TESTS "Build unit tests" ON) -option(ENABLE_LIGHTWEIGHT - "Optimize libtransmission for low-resource systems: smaller cache size, prefer unencrypted peer connections, etc." - OFF) option(ENABLE_UTP "Build µTP support" ON) option(ENABLE_WERROR "Treat warnings as errors" OFF) option(ENABLE_NLS "Enable native language support" ON) diff --git a/docs/Editing-Configuration-Files.md b/docs/Editing-Configuration-Files.md index 6fbea5a4b..a93a88635 100644 --- a/docs/Editing-Configuration-Files.md +++ b/docs/Editing-Configuration-Files.md @@ -69,14 +69,14 @@ Here is a sample of the three basic types: respectively Boolean, Number and Stri _Note: When **watch-dir-enabled** is true, only the transmission-daemon, transmission-gtk, and transmission-qt applications will monitor **watch-dir** for new .torrent files and automatically load them._ #### Misc - * **cache-size-mb:** Size (default = 4), in megabytes, to allocate for Transmission's memory cache. The cache is used to help batch disk IO together, so increasing the cache size can be used to reduce the number of disk reads and writes. Default is 2 if configured with --enable-lightweight. + * **cache-size-mb:** Size (default = 4), in megabytes, to allocate for Transmission's memory cache. The cache is used to help batch disk IO together, so increasing the cache size can be used to reduce the number of disk reads and writes. * **dht-enabled:** Boolean (default = true) Enable [Distributed Hash Table (DHT)](https://wiki.theory.org/BitTorrentSpecification#Distributed_Hash_Table). * **encryption:** Number (0 = Prefer unencrypted connections, 1 = Prefer encrypted connections, 2 = Require encrypted connections; default = 1) [Encryption](https://wiki.vuze.com/w/Message_Stream_Encryption) preference. Encryption may help get around some ISP filtering, but at the cost of slightly higher CPU use. * **lazy-bitfield-enabled:** Boolean (default = true) May help get around some ISP filtering. [Vuze specification](https://wiki.vuze.com/w/Commandline_options#Network_Options). * **lpd-enabled:** Boolean (default = false) Enable [Local Peer Discovery (LPD)](https://en.wikipedia.org/wiki/Local_Peer_Discovery). * **message-level:** Number (0 = None, 1 = Error, 2 = Info, 3 = Debug, default = 2) Set verbosity of transmission messages. * **pex-enabled:** Boolean (default = true) Enable [https://en.wikipedia.org/wiki/Peer_exchange Peer Exchange (PEX)]. - * **prefetch-enabled:** Boolean (default = true). When enabled, Transmission will hint to the OS which piece data it's about to read from disk in order to satisfy requests from peers. On Linux, this is done by passing `POSIX_FADV_WILLNEED` to [posix_fadvise()](https://www.kernel.org/doc/man-pages/online/pages/man2/posix_fadvise.2.html). On macOS, this is done by passing `F_RDADVISE` to [fcntl()](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html). This defaults to false if configured with --enable-lightweight. + * **prefetch-enabled:** Boolean (default = true). When enabled, Transmission will hint to the OS which piece data it's about to read from disk in order to satisfy requests from peers. On Linux, this is done by passing `POSIX_FADV_WILLNEED` to [posix_fadvise()](https://www.kernel.org/doc/man-pages/online/pages/man2/posix_fadvise.2.html). On macOS, this is done by passing `F_RDADVISE` to [fcntl()](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fcntl.2.html). * **scrape-paused-torrents-enabled:** Boolean (default = true) * **script-torrent-added-enabled:** Boolean (default = false) Run a script when a torrent is added to Transmission. Environmental variables are passed in as detailed on the [Scripts](./Scripts.md) page * **script-torrent-added-filename:** String (default = "") Path to script. diff --git a/libtransmission/CMakeLists.txt b/libtransmission/CMakeLists.txt index e17ee9f8c..0952965a4 100644 --- a/libtransmission/CMakeLists.txt +++ b/libtransmission/CMakeLists.txt @@ -227,7 +227,6 @@ target_compile_definitions(${TR_NAME} PACKAGE_DATA_DIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}" $<$:WITH_INOTIFY> $<$:WITH_KQUEUE> - $<$:TR_LIGHTWEIGHT> $<$:WITH_UTP> $<$:MINIUPNPC_API_VERSION=${MINIUPNPC_API_VERSION}> # API version macro was only added in 1.7 $<$:USE_SYSTEM_B64> diff --git a/libtransmission/crypto-utils-openssl.cc b/libtransmission/crypto-utils-openssl.cc index 3ecdb04b7..35d3401c6 100644 --- a/libtransmission/crypto-utils-openssl.cc +++ b/libtransmission/crypto-utils-openssl.cc @@ -37,11 +37,7 @@ static void log_openssl_error(char const* file, int line) if (tr_logLevelIsActive(TR_LOG_ERROR)) { -#ifndef TR_LIGHTWEIGHT - - static bool strings_loaded = false; - - if (!strings_loaded) + if (static bool strings_loaded = false; !strings_loaded) { #if OPENSSL_VERSION_NUMBER < 0x10100000 || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000) ERR_load_crypto_strings(); @@ -52,8 +48,6 @@ static void log_openssl_error(char const* file, int line) strings_loaded = true; } -#endif - auto buf = std::array{}; ERR_error_string_n(error_code, std::data(buf), std::size(buf)); tr_logAddMessage( diff --git a/libtransmission/utils.h b/libtransmission/utils.h index 849db6e73..e735f8cf0 100644 --- a/libtransmission/utils.h +++ b/libtransmission/utils.h @@ -43,7 +43,7 @@ struct tr_error; /* #define DISABLE_GETTEXT */ #ifndef DISABLE_GETTEXT -#if defined(_WIN32) || defined(TR_LIGHTWEIGHT) +#if defined(_WIN32) #define DISABLE_GETTEXT #endif #endif