stop people from using volatile cache and suggest_pieces at the same time

This commit is contained in:
Arvid Norberg 2010-01-31 16:35:38 +00:00
parent 53144f6f14
commit 6a5164b990
1 changed files with 11 additions and 1 deletions

View File

@ -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