From 212c0ba501e01439bf2141696f76d2616fa95dba Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Tue, 25 Jun 2013 11:51:30 -0600 Subject: [PATCH] Avoid "STORE_DISK_CLIENT == getType()" assertions for ENTRY_ABORTED clients and no disk cache configured. StoreEntry::abort() makes entry STORE_OK, which makes storeClientNoMoreToSend() return false for entries with unknown objectLen(), triggering a disk read for some of them (when store_client::doCopy() cannot schedule a memory read). If the entry is not really on disk, we hit an assertion in store_client::scheduleDiskRead(). --- src/store_client.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/store_client.cc b/src/store_client.cc index 3e2da1181c..51a8acb1e7 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -283,6 +283,7 @@ store_client::copy(StoreEntry * anEntry, * do have more data to send. If its STORE_OK, then * we continue checking. If the object length is negative, then we * don't know the real length and must open the swap file to find out. + * However, if there is no swap file, then there is no more to send. * If the length is >= 0, then we compare it to the requested copy * offset. */ @@ -295,7 +296,7 @@ storeClientNoMoreToSend(StoreEntry * e, store_client * sc) return 0; if ((len = e->objectLen()) < 0) - return 0; + return e->swap_filen < 0; if (sc->copyInto.offset < len) return 0; -- 2.47.2