From 6a5164b990a9d95c109af345dfc44676e622cc96 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 31 Jan 2010 16:35:38 +0000 Subject: [PATCH] stop people from using volatile cache and suggest_pieces at the same time --- src/session_impl.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 4a6c2d0c0..f9c348e80 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -999,7 +999,6 @@ namespace aux { // less than 5 seconds unchoke interval is insane TORRENT_ASSERT(s.unchoke_interval >= 5); - // if disk io thread settings were changed // post a notification to that thread bool update_disk_io_thread = false; @@ -1025,6 +1024,17 @@ namespace aux { || m_settings.low_prio_disk != s.low_prio_disk) update_disk_io_thread = true; + // + if (m_settings.volatile_read_cache + && m_settings.suggest_mode == session_settings::suggest_read_cache) + { + // If you hit this assert, you're trying to set your cache to be + // volatile and to suggest pieces out of it at the same time + // this is a bad configuration, don't do it + TORRENT_ASSERT(false); + m_settings.volatile_read_cache = false; + } + // if queuing settings were changed, recalculate // queued torrents sooner if ((m_settings.active_downloads != s.active_downloads