From 8e92cad2db2aa828d6d2cd7842a65c64ab53aaec Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 17 Apr 2011 05:33:33 +0000 Subject: [PATCH] fixed bug in avoid_readback disk cache eviction algorithm --- src/disk_io_thread.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/disk_io_thread.cpp b/src/disk_io_thread.cpp index 0d037f31d..d7255dc6b 100644 --- a/src/disk_io_thread.cpp +++ b/src/disk_io_thread.cpp @@ -642,6 +642,8 @@ namespace libtorrent ret += tmp; } while (tmp > 0 && blocks > 0); + if (blocks == 0) return ret; + if (options & dont_flush_write_blocks) return ret; // if we don't have any blocks in the cache, no need to go look for any