]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Avoid "STORE_DISK_CLIENT == getType()" assertions for ENTRY_ABORTED clients
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 25 Jun 2013 17:51:30 +0000 (11:51 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 25 Jun 2013 17:51:30 +0000 (11:51 -0600)
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

index 3e2da1181c7e7ab2530939f7557eaed50ae8025d..51a8acb1e7bf99e4838ac6ac35cfe667c0c39dfa 100644 (file)
@@ -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;