|
|
|
@ -276,6 +276,7 @@ Session::Session(QObject *parent)
@@ -276,6 +276,7 @@ Session::Session(QObject *parent)
|
|
|
|
|
, m_announceToAllTrackers(BITTORRENT_SESSION_KEY("AnnounceToAllTrackers"), false) |
|
|
|
|
, m_announceToAllTiers(BITTORRENT_SESSION_KEY("AnnounceToAllTiers"), true) |
|
|
|
|
, m_asyncIOThreads(BITTORRENT_SESSION_KEY("AsyncIOThreadsCount"), 4) |
|
|
|
|
, m_checkingMemUsage(BITTORRENT_SESSION_KEY("CheckingMemUsageSize"), 16) |
|
|
|
|
, m_diskCacheSize(BITTORRENT_SESSION_KEY("DiskCacheSize"), 64) |
|
|
|
|
, m_diskCacheTTL(BITTORRENT_SESSION_KEY("DiskCacheTTL"), 60) |
|
|
|
|
, m_useOSCache(BITTORRENT_SESSION_KEY("UseOSCache"), true) |
|
|
|
@ -1318,6 +1319,9 @@ void Session::configure(libtorrent::settings_pack &settingsPack)
@@ -1318,6 +1319,9 @@ void Session::configure(libtorrent::settings_pack &settingsPack)
|
|
|
|
|
|
|
|
|
|
settingsPack.set_int(libt::settings_pack::aio_threads, asyncIOThreads()); |
|
|
|
|
|
|
|
|
|
const int checkingMemUsageSize = checkingMemUsage() * 64; |
|
|
|
|
settingsPack.set_int(libt::settings_pack::checking_mem_usage, checkingMemUsageSize); |
|
|
|
|
|
|
|
|
|
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()); |
|
|
|
@ -3083,6 +3087,22 @@ void Session::setAsyncIOThreads(const int num)
@@ -3083,6 +3087,22 @@ void Session::setAsyncIOThreads(const int num)
|
|
|
|
|
configureDeferred(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int Session::checkingMemUsage() const |
|
|
|
|
{ |
|
|
|
|
return qMax(1, m_checkingMemUsage.value()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Session::setCheckingMemUsage(int size) |
|
|
|
|
{ |
|
|
|
|
size = qMax(size, 1); |
|
|
|
|
|
|
|
|
|
if (size == m_checkingMemUsage) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
m_checkingMemUsage = size; |
|
|
|
|
configureDeferred(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int Session::diskCacheSize() const |
|
|
|
|
{ |
|
|
|
|
int size = m_diskCacheSize; |
|
|
|
|