Hello community, here is the log from the commit of package qbittorrent for openSUSE:Factory checked in at 2017-09-09 20:26:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qbittorrent (Old) and /work/SRC/openSUSE:Factory/.qbittorrent.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qbittorrent" Sat Sep 9 20:26:52 2017 rev:58 rq:522297 version:3.3.16 Changes: -------- --- /work/SRC/openSUSE:Factory/qbittorrent/qbittorrent.changes 2017-08-06 11:34:17.943653751 +0200 +++ /work/SRC/openSUSE:Factory/.qbittorrent.new/qbittorrent.changes 2017-09-09 20:26:53.711042189 +0200 @@ -1,0 +2,18 @@ +Fri Sep 8 06:48:45 UTC 2017 - [email protected] + +- Update to version 3.3.16 + * BUGFIX: Better memory footprint when using libtorrent 1.1.x. + The cache is turned off by default(`0 (disabled)` value in + the settings). The value `-1 (auto)` makes it use 1/8 of + your RAM. (sledgehammer999) + * BUGFIX: Skip user input events when adding torrent. Closes + #7327. (glassez) + * BUGFIX: Avoid memory leak in the speed graph. (Chocobo1) + * WEBUI: Fix validating wrong header field. X-Forwarded-Host is + a foreign proxy setting, it isn't the same as qbt's local + setting and thus it makes no sense to verify it. Closes #7311. + (Chocobo1) + +- Refreshed qbittorrent-libtorrent-1.1.1.patch + +------------------------------------------------------------------- Old: ---- qbittorrent-3.3.15.tar.xz qbittorrent-3.3.15.tar.xz.asc New: ---- qbittorrent-3.3.16.tar.xz qbittorrent-3.3.16.tar.xz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qbittorrent.spec ++++++ --- /var/tmp/diff_new_pack.eZ48Os/_old 2017-09-09 20:26:54.522927752 +0200 +++ /var/tmp/diff_new_pack.eZ48Os/_new 2017-09-09 20:26:54.534926061 +0200 @@ -18,7 +18,7 @@ Name: qbittorrent -Version: 3.3.15 +Version: 3.3.16 Release: 0 Summary: A BitTorrent client in Qt License: GPL-2.0+ @@ -97,6 +97,7 @@ pushd $ui %configure \ $ui_opt \ + --prefix=%{_prefix} \ %if 0%{?suse_version} < 1320 && !(0%{?sle_version} >= 120100 && 0%{?is_opensuse}) --with-qt4 \ %endif ++++++ qbittorrent-3.3.15.tar.xz -> qbittorrent-3.3.16.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qbittorrent-3.3.15/Changelog new/qbittorrent-3.3.16/Changelog --- old/qbittorrent-3.3.15/Changelog 2017-08-03 22:30:10.000000000 +0200 +++ new/qbittorrent-3.3.16/Changelog 2017-09-07 18:15:54.000000000 +0200 @@ -1,3 +1,12 @@ +* Thu Sep 07 2017 - sledgehammer999 <[email protected]> - v3.3.16 + - BUGFIX: Better memory footprint when using libtorrent 1.1.x. The cache is turned off by default(`0 (disabled)` value in the settings). The value `-1 (auto)` makes it use 1/8 of your RAM. (sledgehammer999) + - BUGFIX: Skip user input events when adding torrent. Closes #7327. (glassez) + - BUGFIX: Avoid memory leak in the speed graph. (Chocobo1) + - WEBUI: Fix validating wrong header field. X-Forwarded-Host is a foreign proxy setting, it isn't the same as qbt's local setting and thus it makes no sense to verify it. Closes #7311. (Chocobo1) + - WINDOWS: Fix connection problems when a specific interface/ip is configured. (sledgehammer999) + - WINDOWS: Disable skipping of loopback interfaces. This fixes the absence of VPN tunnel interfaces under Windows and works around the QTBUG-32349. Fixes #7291. (Evengard) + - WINDOWS: The installer detects the 64bit running process too. (vlakoff) + * Thu Aug 03 2017 - sledgehammer999 <[email protected]> - v3.3.15 - BUGFIX: Temporary subfolder wasn't being deleted. (glassez) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qbittorrent-3.3.15/dist/mac/Info.plist new/qbittorrent-3.3.16/dist/mac/Info.plist --- old/qbittorrent-3.3.15/dist/mac/Info.plist 2017-08-03 22:30:10.000000000 +0200 +++ new/qbittorrent-3.3.16/dist/mac/Info.plist 2017-09-07 18:15:54.000000000 +0200 @@ -45,7 +45,7 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>3.3.15</string> + <string>3.3.16</string> <key>CFBundleSignature</key> <string>qBit</string> <key>CFBundleExecutable</key> Binary files old/qbittorrent-3.3.15/dist/windows/nsis plugins/FindProc Unicode-source.zip and new/qbittorrent-3.3.16/dist/windows/nsis plugins/FindProc Unicode-source.zip differ Binary files old/qbittorrent-3.3.15/dist/windows/nsis plugins/FindProcDLL Unicode bin.zip and new/qbittorrent-3.3.16/dist/windows/nsis plugins/FindProcDLL Unicode bin.zip differ Binary files old/qbittorrent-3.3.15/dist/windows/nsis plugins/FindProcDLL_mod_by_hnedka.7z and new/qbittorrent-3.3.16/dist/windows/nsis plugins/FindProcDLL_mod_by_hnedka.7z differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qbittorrent-3.3.15/dist/windows/options.nsi new/qbittorrent-3.3.16/dist/windows/options.nsi --- old/qbittorrent-3.3.15/dist/windows/options.nsi 2017-08-03 22:30:10.000000000 +0200 +++ new/qbittorrent-3.3.16/dist/windows/options.nsi 2017-09-07 18:15:54.000000000 +0200 @@ -27,7 +27,7 @@ !define CSIDL_LOCALAPPDATA '0x1C' ;Local Application Data path ; Program specific -!define PROG_VERSION "3.3.15" +!define PROG_VERSION "3.3.16" !define MUI_FINISHPAGE_RUN !define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qbittorrent-3.3.15/src/base/bittorrent/session.cpp new/qbittorrent-3.3.16/src/base/bittorrent/session.cpp --- old/qbittorrent-3.3.15/src/base/bittorrent/session.cpp 2017-08-03 22:30:10.000000000 +0200 +++ new/qbittorrent-3.3.16/src/base/bittorrent/session.cpp 2017-09-07 18:15:54.000000000 +0200 @@ -42,6 +42,7 @@ #include <QString> #include <QThread> #include <QTimer> +#include <QUuid> #include <cstdlib> #include <queue> @@ -88,6 +89,14 @@ #include "tracker.h" #include "trackerentry.h" +#ifdef Q_OS_WIN +#include <iphlpapi.h> +#endif + +#if defined(Q_OS_WIN) && (_WIN32_WINNT < 0x0600) +using NETIO_STATUS = LONG; +#endif + static const char PEER_ID[] = "qB"; static const char RESUME_FOLDER[] = "BT_backup"; static const char USER_AGENT[] = "qBittorrent/" QBT_VERSION_2; @@ -105,6 +114,10 @@ void torrentQueuePositionTop(const libt::torrent_handle &handle); void torrentQueuePositionBottom(const libt::torrent_handle &handle); +#ifdef Q_OS_WIN + QString convertIfaceNameToGuid(const QString &name); +#endif + inline SettingsStorage *settings() { return SettingsStorage::instance(); } QStringMap map_cast(const QVariantMap &map) @@ -313,6 +326,10 @@ sessionSettings.connection_speed = 20; // default is 10 sessionSettings.no_connect_privileged_ports = false; sessionSettings.seed_choking_algorithm = libt::session_settings::fastest_upload; + // Disk cache pool is rarely tested in libtorrent and doesn't free buffers + // Soon to be deprecated there + // More info: https://github.com/arvidn/libtorrent/issues/2251 + sessionSettings.use_disk_cache_pool = false; configure(sessionSettings); m_nativeSession->set_settings(sessionSettings); configureListeningInterface(); @@ -340,6 +357,10 @@ pack.set_int(libt::settings_pack::connection_speed, 20); // default is 10 pack.set_bool(libt::settings_pack::no_connect_privileged_ports, false); pack.set_int(libt::settings_pack::seed_choking_algorithm, libt::settings_pack::fastest_upload); + // Disk cache pool is rarely tested in libtorrent and doesn't free buffers + // Soon to be deprecated there + // More info: https://github.com/arvidn/libtorrent/issues/2251 + pack.set_bool(libt::settings_pack::use_disk_cache_pool, false); configure(pack); m_nativeSession = new libt::session(pack, 0); @@ -900,6 +921,10 @@ { Logger* const logger = Logger::instance(); +#ifdef Q_OS_WIN + QString chosenIP; +#endif + if (m_listenInterfaceChanged) { const ushort port = this->port(); std::pair<int, int> ports(port, port); @@ -929,11 +954,31 @@ .arg(ip).arg(port) , Log::INFO); settingsPack.set_str(libt::settings_pack::listen_interfaces, interfacesStr); +#ifdef Q_OS_WIN + chosenIP = ip; +#endif break; } } +#ifdef Q_OS_WIN + // On Vista+ versions and after Qt 5.5 QNetworkInterface::name() returns + // the interface's Luid and not the GUID. + // Libtorrent expects GUIDs for the 'outgoing_interfaces' setting. + if (!networkInterface().isEmpty()) { + QString guid = convertIfaceNameToGuid(networkInterface()); + if (!guid.isEmpty()) { + settingsPack.set_str(libt::settings_pack::outgoing_interfaces, guid.toStdString()); + } + else { + settingsPack.set_str(libt::settings_pack::outgoing_interfaces, chosenIP.toStdString()); + LogMsg(tr("Could not get GUID of configured network interface. Binding to IP %1").arg(chosenIP) + , Log::WARNING); + } + } +#else settingsPack.set_str(libt::settings_pack::outgoing_interfaces, networkInterface().toStdString()); +#endif m_listenInterfaceChanged = false; } @@ -999,8 +1044,8 @@ settingsPack.set_bool(libt::settings_pack::announce_to_all_trackers, announceToAll); settingsPack.set_bool(libt::settings_pack::announce_to_all_tiers, announceToAll); - const int cacheSize = diskCacheSize(); - settingsPack.set_int(libt::settings_pack::cache_size, (cacheSize > 0) ? cacheSize * 64 : -1); + const int cacheSize = (diskCacheSize() > -1) ? diskCacheSize() * 64 : -1; + settingsPack.set_int(libt::settings_pack::cache_size, cacheSize); settingsPack.set_int(libt::settings_pack::cache_expiry, diskCacheTTL()); qDebug() << "Using a disk cache size of" << cacheSize << "MiB"; @@ -1146,8 +1191,8 @@ bool announceToAll = announceToAllTrackers(); sessionSettings.announce_to_all_trackers = announceToAll; sessionSettings.announce_to_all_tiers = announceToAll; - int cacheSize = diskCacheSize(); - sessionSettings.cache_size = (cacheSize > 0) ? cacheSize * 64 : -1; + const int cacheSize = (diskCacheSize() > -1) ? diskCacheSize() * 64 : -1; + sessionSettings.cache_size = cacheSize; sessionSettings.cache_expiry = diskCacheTTL(); qDebug() << "Using a disk cache size of" << cacheSize << "MiB"; libt::session_settings::io_buffer_mode_t mode = useOSCache() ? libt::session_settings::enable_os_cache @@ -1716,7 +1761,7 @@ torrentInfo.renameFile(i, filePath + QB_EXT); } if ((i % 100) == 0) - qApp->processEvents(); + qApp->processEvents(QEventLoop::ExcludeUserInputEvents); } return found; @@ -2217,10 +2262,10 @@ return m_networkInterface; } -void Session::setNetworkInterface(const QString &interface) +void Session::setNetworkInterface(const QString &iface) { - if (interface != networkInterface()) { - m_networkInterface = interface; + if (iface != networkInterface()) { + m_networkInterface = iface; configureListeningInterface(); } } @@ -2413,27 +2458,27 @@ } } -uint Session::diskCacheSize() const +int Session::diskCacheSize() const { - uint size = m_diskCacheSize; + int size = m_diskCacheSize; // These macros may not be available on compilers other than MSVC and GCC #if defined(__x86_64__) || defined(_M_X64) - size = qMin(size, 4096u); // 4GiB + size = qMin(size, 4096); // 4GiB #else // When build as 32bit binary, set the maximum at less than 2GB to prevent crashes // allocate 1536MiB and leave 512MiB to the rest of program data in RAM - size = qMin(size, 1536u); + size = qMin(size, 1536); #endif return size; } -void Session::setDiskCacheSize(uint size) +void Session::setDiskCacheSize(int size) { #if defined(__x86_64__) || defined(_M_X64) - size = qMin(size, 4096u); // 4GiB + size = qMin(size, 4096); // 4GiB #else // allocate 1536MiB and leave 512MiB to the rest of program data in RAM - size = qMin(size, 1536u); + size = qMin(size, 1536); #endif if (size != m_diskCacheSize) { m_diskCacheSize = size; @@ -3602,4 +3647,32 @@ qDebug() << Q_FUNC_INFO << " fails: " << exc.what(); } } + +#ifdef Q_OS_WIN + QString convertIfaceNameToGuid(const QString &name) + { + // Under Windows XP or on Qt version <= 5.5 'name' will be a GUID already. + QUuid uuid(name); + if (!uuid.isNull()) + return uuid.toString().toUpper(); // Libtorrent expects the GUID in uppercase + + using PCONVERTIFACENAMETOLUID = NETIO_STATUS (WINAPI *)(const WCHAR *, PNET_LUID); + PCONVERTIFACENAMETOLUID ConvertIfaceNameToLuid = reinterpret_cast<PCONVERTIFACENAMETOLUID>(::GetProcAddress(::GetModuleHandleW(L"Iphlpapi.dll"), "ConvertInterfaceNameToLuidW")); + if (!ConvertIfaceNameToLuid) return QString(); + + using PCONVERTIFACELUIDTOGUID = NETIO_STATUS (WINAPI *)(const NET_LUID *, GUID *); + PCONVERTIFACELUIDTOGUID ConvertIfaceLuidToGuid = reinterpret_cast<PCONVERTIFACELUIDTOGUID>(::GetProcAddress(::GetModuleHandleW(L"Iphlpapi.dll"), "ConvertInterfaceLuidToGuid")); + if (!ConvertIfaceLuidToGuid) return QString(); + + NET_LUID luid; + LONG res = ConvertIfaceNameToLuid(name.toStdWString().c_str(), &luid); + if (res == 0) { + GUID guid; + if (ConvertIfaceLuidToGuid(&luid, &guid) == 0) + return QUuid(guid).toString().toUpper(); + } + + return QString(); + } +#endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qbittorrent-3.3.15/src/base/bittorrent/session.h new/qbittorrent-3.3.16/src/base/bittorrent/session.h --- old/qbittorrent-3.3.15/src/base/bittorrent/session.h 2017-08-03 22:30:10.000000000 +0200 +++ new/qbittorrent-3.3.16/src/base/bittorrent/session.h 2017-09-07 18:15:54.000000000 +0200 @@ -279,8 +279,8 @@ void setIPFilterFile(QString path); bool announceToAllTrackers() const; void setAnnounceToAllTrackers(bool val); - uint diskCacheSize() const; - void setDiskCacheSize(uint size); + int diskCacheSize() const; + void setDiskCacheSize(int size); uint diskCacheTTL() const; void setDiskCacheTTL(uint ttl); bool useOSCache() const; @@ -508,7 +508,7 @@ CachedSettingValue<bool> m_isTrackerFilteringEnabled; CachedSettingValue<QString> m_IPFilterFile; CachedSettingValue<bool> m_announceToAllTrackers; - CachedSettingValue<uint> m_diskCacheSize; + CachedSettingValue<int> m_diskCacheSize; CachedSettingValue<uint> m_diskCacheTTL; CachedSettingValue<bool> m_useOSCache; CachedSettingValue<bool> m_isAnonymousModeEnabled; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qbittorrent-3.3.15/src/gui/advancedsettings.cpp new/qbittorrent-3.3.16/src/gui/advancedsettings.cpp --- old/qbittorrent-3.3.15/src/gui/advancedsettings.cpp 2017-08-03 22:30:10.000000000 +0200 +++ new/qbittorrent-3.3.16/src/gui/advancedsettings.cpp 2017-09-07 18:15:54.000000000 +0200 @@ -190,7 +190,9 @@ void AdvancedSettings::updateCacheSpinSuffix(int value) { - if (value <= 0) + if (value == 0) + spin_cache.setSuffix(tr(" (disabled)")); + else if (value < 0) spin_cache.setSuffix(tr(" (auto)")); else spin_cache.setSuffix(tr(" MiB")); @@ -251,7 +253,7 @@ labelLibtorrentLink.setText(QString("<a href=\"%1\">%2</a>").arg("http://www.libtorrent.org/reference.html").arg(tr("Open documentation"))); labelLibtorrentLink.setOpenExternalLinks(true); // Disk write cache - spin_cache.setMinimum(0); + spin_cache.setMinimum(-1); // When build as 32bit binary, set the maximum at less than 2GB to prevent crashes. // These macros may not be available on compilers other than MSVC and GCC #if defined(__x86_64__) || defined(_M_X64) @@ -323,7 +325,6 @@ // https://github.com/qbittorrent/qBittorrent/pull/5135 if (iface.addressEntries().isEmpty()) continue; - if (iface.flags() & QNetworkInterface::IsLoopBack) continue; combo_iface.addItem(iface.humanReadableName(), iface.name()); if (!current_iface.isEmpty() && (iface.name() == current_iface)) { combo_iface.setCurrentIndex(i); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qbittorrent-3.3.15/src/gui/properties/speedwidget.cpp new/qbittorrent-3.3.16/src/gui/properties/speedwidget.cpp --- old/qbittorrent-3.3.15/src/gui/properties/speedwidget.cpp 2017-08-03 22:30:10.000000000 +0200 +++ new/qbittorrent-3.3.16/src/gui/properties/speedwidget.cpp 2017-09-07 18:15:54.000000000 +0200 @@ -86,7 +86,7 @@ m_graphsMenu->addAction(tr("Tracker Download")); m_graphsMenuActions = m_graphsMenu->actions(); - m_graphsSignalMapper = new QSignalMapper(); + m_graphsSignalMapper = new QSignalMapper(this); for (int id = SpeedPlotView::UP; id < SpeedPlotView::NB_GRAPHS; ++id) { QAction *action = m_graphsMenuActions.at(id); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qbittorrent-3.3.15/src/webui/abstractwebapplication.cpp new/qbittorrent-3.3.16/src/webui/abstractwebapplication.cpp --- old/qbittorrent-3.3.15/src/webui/abstractwebapplication.cpp 2017-08-03 22:30:10.000000000 +0200 +++ new/qbittorrent-3.3.16/src/webui/abstractwebapplication.cpp 2017-09-07 18:15:54.000000000 +0200 @@ -424,8 +424,7 @@ bool AbstractWebApplication::validateHostHeader(const Http::Request &request, const Http::Environment &env, const QStringList &domains) const { - const QUrl hostHeader = QUrl::fromUserInput( - request.headers.value(Http::HEADER_X_FORWARDED_HOST, request.headers.value(Http::HEADER_HOST))); + const QUrl hostHeader = QUrl::fromUserInput(request.headers.value(Http::HEADER_HOST)); // (if present) try matching host header's port with local port const int requestPort = hostHeader.port(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qbittorrent-3.3.15/version.pri new/qbittorrent-3.3.16/version.pri --- old/qbittorrent-3.3.15/version.pri 2017-08-03 22:30:10.000000000 +0200 +++ new/qbittorrent-3.3.16/version.pri 2017-09-07 18:15:55.000000000 +0200 @@ -4,7 +4,7 @@ # Define version numbers here VER_MAJOR = 3 VER_MINOR = 3 -VER_BUGFIX = 15 +VER_BUGFIX = 16 VER_BUILD = 0 VER_STATUS = # Should be empty for stable releases! ++++++ qbittorrent-libtorrent-1.1.1.patch ++++++ --- /var/tmp/diff_new_pack.eZ48Os/_old 2017-09-09 20:26:55.798747924 +0200 +++ /var/tmp/diff_new_pack.eZ48Os/_new 2017-09-09 20:26:55.802747360 +0200 @@ -1,7 +1,9 @@ ---- a/src/base/bittorrent/session.cpp -+++ b/src/base/bittorrent/session.cpp -@@ -44,6 +44,9 @@ - #include <QTimer> +Index: qbittorrent-3.3.16/src/base/bittorrent/session.cpp +=================================================================== +--- qbittorrent-3.3.16.orig/src/base/bittorrent/session.cpp ++++ qbittorrent-3.3.16/src/base/bittorrent/session.cpp +@@ -45,6 +45,9 @@ + #include <QUuid> #include <cstdlib> +#if LIBTORRENT_VERSION_NUM >= 10100 && LIBTORRENT_VERSION_NUM < 10102 @@ -10,7 +12,7 @@ #include <queue> #include <vector> -@@ -183,6 +186,36 @@ namespace +@@ -196,6 +199,36 @@ namespace template <typename T> LowerLimited<T> lowerLimited(T limit, T ret) { return LowerLimited<T>(limit, ret); } @@ -47,7 +49,7 @@ } // Session -@@ -321,7 +354,11 @@ Session::Session(QObject *parent) +@@ -338,7 +371,11 @@ Session::Session(QObject *parent) dispatchAlerts(alertPtr.release()); }); #else
