From: Alex Rousskov Date: Tue, 25 Jun 2013 17:51:30 +0000 (-0600) Subject: Avoid "STORE_DISK_CLIENT == getType()" assertions for ENTRY_ABORTED clients X-Git-Tag: SQUID_3_5_0_1~444^2~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=212c0ba501e01439bf2141696f76d2616fa95dba;p=thirdparty%2Fsquid.git 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(). --- 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;