From e48612a70318af8cfc42c6a717ed49b4e89959fd Mon Sep 17 00:00:00 2001 From: NotTsunami <4589807+NotTsunami@users.noreply.github.com> Date: Sat, 4 Apr 2020 21:35:08 -0400 Subject: [PATCH] Set disk cache size for older libtorrent versions Libtorrent versions older than 1.2.6 have a bug when setting disk cache size to auto. See https://github.com/arvidn/libtorrent/commit/6c880159c927f87ae4013e32023eb89a5336b5a4. --- src/base/bittorrent/session.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 418b617cd..e1071fbc5 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -377,7 +377,11 @@ Session::Session(QObject *parent) , m_asyncIOThreads(BITTORRENT_SESSION_KEY("AsyncIOThreadsCount"), 4) , m_filePoolSize(BITTORRENT_SESSION_KEY("FilePoolSize"), 40) , m_checkingMemUsage(BITTORRENT_SESSION_KEY("CheckingMemUsageSize"), 32) +#if (LIBTORRENT_VERSION_NUM >= 10206) , m_diskCacheSize(BITTORRENT_SESSION_KEY("DiskCacheSize"), -1) +#else + , m_diskCacheSize(BITTORRENT_SESSION_KEY("DiskCacheSize"), 64) +#endif , m_diskCacheTTL(BITTORRENT_SESSION_KEY("DiskCacheTTL"), 60) , m_useOSCache(BITTORRENT_SESSION_KEY("UseOSCache"), true) #ifdef Q_OS_WIN