diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1f72ba2f2..ddd947644 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,11 +12,11 @@ on: env: # Qt: 5.15.1 - # libtorrent: RC_1_2 HEAD, 1.2.11 + # libtorrent: RC_1_2 HEAD, 1.2.12 VCPKG_COMMIT: 133051b793486ef14e67e9d1f48c9cfe64dc127e VCPKG_DEST_MACOS: /Users/runner/qbt_tools/vcpkg VCPKG_DEST_WIN: C:\qbt_tools\vcpkg - LIBTORRENT_VERSION_TAG: v1.2.11 + LIBTORRENT_VERSION_TAG: v1.2.12 jobs: diff --git a/.travis.yml b/.travis.yml index dfc3ccb9a..0c7115e5c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -125,7 +125,7 @@ install: pushd "$HOME" git clone --single-branch --branch RC_1_2 https://github.com/arvidn/libtorrent.git cd libtorrent - git checkout tags/v1.2.11 + git checkout tags/v1.2.12 cmake \ -DCMAKE_BUILD_TYPE=Release \ @@ -140,7 +140,7 @@ install: pushd "$HOME" git clone --single-branch --branch RC_2_0 https://github.com/arvidn/libtorrent.git cd libtorrent - git checkout tags/v2.0.1 + git checkout tags/v2.0.2 git submodule update --init --recursive cmake \ diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f952c8c1..6b313668c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON) set(minBoostVersion 1.65) set(minQtVersion 5.9.5) set(minOpenSSLVersion 1.1.1) -set(minLibtorrentVersion 1.2.11) +set(minLibtorrentVersion 1.2.12) set(minZlibVersion 1.2.11) # features (some are platform-specific) diff --git a/INSTALL b/INSTALL index 86d341548..a0fab7e75 100644 --- a/INSTALL +++ b/INSTALL @@ -5,7 +5,7 @@ qBittorrent - A BitTorrent client in C++ / Qt - Boost >= 1.65 - - libtorrent-rasterbar >= 1.2.11 (by Arvid Norberg) + - libtorrent-rasterbar >= 1.2.12 (by Arvid Norberg) * https://www.libtorrent.org/ * Be careful: another library (the one used by rTorrent) uses a similar name diff --git a/configure b/configure index 398a1ffca..1097ba646 100755 --- a/configure +++ b/configure @@ -6354,12 +6354,12 @@ if test -n "$libtorrent_CFLAGS"; then pkg_cv_libtorrent_CFLAGS="$libtorrent_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent-rasterbar >= 1.2.11\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libtorrent-rasterbar >= 1.2.11") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent-rasterbar >= 1.2.12\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libtorrent-rasterbar >= 1.2.12") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libtorrent_CFLAGS=`$PKG_CONFIG --cflags "libtorrent-rasterbar >= 1.2.11" 2>/dev/null` + pkg_cv_libtorrent_CFLAGS=`$PKG_CONFIG --cflags "libtorrent-rasterbar >= 1.2.12" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -6371,12 +6371,12 @@ if test -n "$libtorrent_LIBS"; then pkg_cv_libtorrent_LIBS="$libtorrent_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent-rasterbar >= 1.2.11\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libtorrent-rasterbar >= 1.2.11") 2>&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libtorrent-rasterbar >= 1.2.12\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libtorrent-rasterbar >= 1.2.12") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_libtorrent_LIBS=`$PKG_CONFIG --libs "libtorrent-rasterbar >= 1.2.11" 2>/dev/null` + pkg_cv_libtorrent_LIBS=`$PKG_CONFIG --libs "libtorrent-rasterbar >= 1.2.12" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -6397,14 +6397,14 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - libtorrent_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libtorrent-rasterbar >= 1.2.11" 2>&1` + libtorrent_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libtorrent-rasterbar >= 1.2.12" 2>&1` else - libtorrent_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libtorrent-rasterbar >= 1.2.11" 2>&1` + libtorrent_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libtorrent-rasterbar >= 1.2.12" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$libtorrent_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (libtorrent-rasterbar >= 1.2.11) were not met: + as_fn_error $? "Package requirements (libtorrent-rasterbar >= 1.2.12) were not met: $libtorrent_PKG_ERRORS diff --git a/configure.ac b/configure.ac index ef0428d4b..58430d679 100644 --- a/configure.ac +++ b/configure.ac @@ -180,7 +180,7 @@ AC_MSG_NOTICE([Boost.System LIB: "$BOOST_SYSTEM_LIB"]) LIBS="$BOOST_SYSTEM_LIB $LIBS" PKG_CHECK_MODULES(libtorrent, - [libtorrent-rasterbar >= 1.2.11], + [libtorrent-rasterbar >= 1.2.12], [CXXFLAGS="$libtorrent_CFLAGS $CXXFLAGS" LIBS="$libtorrent_LIBS $LIBS"]) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index a6d0f6acc..1dc672ac9 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -1387,15 +1387,11 @@ void Session::loadLTSettings(lt::settings_pack &settingsPack) break; } -#ifdef HAS_IDN_SUPPORT settingsPack.set_bool(lt::settings_pack::allow_idna, isIDNSupportEnabled()); -#endif settingsPack.set_bool(lt::settings_pack::allow_multiple_connections_per_ip, multiConnectionsPerIpEnabled()); -#ifdef HAS_HTTPS_TRACKER_VALIDATION settingsPack.set_bool(lt::settings_pack::validate_https_trackers, validateHTTPSTrackerCertificate()); -#endif settingsPack.set_bool(lt::settings_pack::no_connect_privileged_ports, blockPeersOnPrivilegedPorts()); diff --git a/src/base/bittorrent/session.h b/src/base/bittorrent/session.h index 703137c45..e746925d7 100644 --- a/src/base/bittorrent/session.h +++ b/src/base/bittorrent/session.h @@ -51,14 +51,6 @@ #include "sessionstatus.h" #include "torrentinfo.h" -#if !defined(Q_OS_WIN) || (LIBTORRENT_VERSION_NUM >= 10212) -#define HAS_HTTPS_TRACKER_VALIDATION -#endif - -#if ((LIBTORRENT_VERSION_NUM >= 10212) && (LIBTORRENT_VERSION_NUM < 20000)) || (LIBTORRENT_VERSION_NUM >= 20002) -#define HAS_IDN_SUPPORT -#endif - class QFile; class QNetworkConfiguration; class QNetworkConfigurationManager; diff --git a/src/gui/advancedsettings.cpp b/src/gui/advancedsettings.cpp index 57f2d89df..85eefeb61 100644 --- a/src/gui/advancedsettings.cpp +++ b/src/gui/advancedsettings.cpp @@ -116,13 +116,9 @@ namespace OUTGOING_PORT_MAX, UPNP_LEASE_DURATION, UTP_MIX_MODE, -#ifdef HAS_IDN_SUPPORT IDN_SUPPORT, -#endif MULTI_CONNECTIONS_PER_IP, -#ifdef HAS_HTTPS_TRACKER_VALIDATION VALIDATE_HTTPS_TRACKER_CERTIFICATE, -#endif BLOCK_PEERS_ON_PRIVILEGED_PORTS, // seeding CHOKING_ALGORITHM, @@ -229,16 +225,12 @@ void AdvancedSettings::saveAdvancedSettings() session->setUPnPLeaseDuration(m_spinBoxUPnPLeaseDuration.value()); // uTP-TCP mixed mode session->setUtpMixedMode(static_cast(m_comboBoxUtpMixedMode.currentIndex())); -#ifdef HAS_IDN_SUPPORT // Support internationalized domain name (IDN) session->setIDNSupportEnabled(m_checkBoxIDNSupport.isChecked()); -#endif // multiple connections per IP session->setMultiConnectionsPerIpEnabled(m_checkBoxMultiConnectionsPerIp.isChecked()); -#ifdef HAS_HTTPS_TRACKER_VALIDATION // Validate HTTPS tracker certificate session->setValidateHTTPSTrackerCertificate(m_checkBoxValidateHTTPSTrackerCertificate.isChecked()); -#endif // Disallow connection to peers on privileged ports session->setBlockPeersOnPrivilegedPorts(m_checkBoxBlockPeersOnPrivilegedPorts.isChecked()); // Recheck torrents on completion @@ -556,25 +548,21 @@ void AdvancedSettings::loadAdvancedSettings() addRow(UTP_MIX_MODE, (tr("%1-TCP mixed mode algorithm", "uTP-TCP mixed mode algorithm").arg(C_UTP) + ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#mixed_mode_algorithm", "(?)")) , &m_comboBoxUtpMixedMode); -#ifdef HAS_IDN_SUPPORT // Support internationalized domain name (IDN) m_checkBoxIDNSupport.setChecked(session->isIDNSupportEnabled()); addRow(IDN_SUPPORT, (tr("Support internationalized domain name (IDN)") + ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#allow_idna", "(?)")) , &m_checkBoxIDNSupport); -#endif // multiple connections per IP m_checkBoxMultiConnectionsPerIp.setChecked(session->multiConnectionsPerIpEnabled()); addRow(MULTI_CONNECTIONS_PER_IP, (tr("Allow multiple connections from the same IP address") + ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#allow_multiple_connections_per_ip", "(?)")) , &m_checkBoxMultiConnectionsPerIp); -#ifdef HAS_HTTPS_TRACKER_VALIDATION // Validate HTTPS tracker certificate m_checkBoxValidateHTTPSTrackerCertificate.setChecked(session->validateHTTPSTrackerCertificate()); addRow(VALIDATE_HTTPS_TRACKER_CERTIFICATE, (tr("Validate HTTPS tracker certificates") + ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#validate_https_trackers", "(?)")) , &m_checkBoxValidateHTTPSTrackerCertificate); -#endif // Disallow connection to peers on privileged ports m_checkBoxBlockPeersOnPrivilegedPorts.setChecked(session->blockPeersOnPrivilegedPorts()); addRow(BLOCK_PEERS_ON_PRIVILEGED_PORTS, (tr("Disallow connection to peers on privileged ports") + ' ' + makeLink("https://libtorrent.org/single-page-ref.html#no_connect_privileged_ports", "(?)")), &m_checkBoxBlockPeersOnPrivilegedPorts);