Allow control of cache expiry interval (libtorrent 0.16.10 allocator can now return cache to kernel)

This commit is contained in:
Nick Tiskov 2013-03-18 13:45:30 +04:00
parent 2647d9e994
commit 6b660d505c
3 changed files with 36 additions and 1 deletions

View file

@ -422,6 +422,9 @@ void QBtSession::configureSession() {
sessionSettings.auto_scrape_min_interval = 900; // 15 minutes
int cache_size = pref.diskCacheSize();
sessionSettings.cache_size = cache_size ? cache_size * 64 : -1;
#if LIBTORRENT_VERSION_NUM >= 001610
sessionSettings.cache_expiry = pref.diskCacheTTL();
#endif
qDebug() << "Using a disk cache size of" << cache_size << "MiB";
#if LIBTORRENT_VERSION_NUM >= 001600
sessionSettings.anonymous_mode = pref.isAnonymousModeEnabled();