]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix storeClientCopy2() bug. We can't compare copy_offset to
authorwessels <>
Sat, 15 Nov 1997 00:22:09 +0000 (00:22 +0000)
committerwessels <>
Sat, 15 Nov 1997 00:22:09 +0000 (00:22 +0000)
inmem_hi because for inmem_hi == 0 for swapped out objects.  Must
compare object_len instead!

src/store.cc

index 54fa65b2df3f80aaccce04f0fdeda424ba344c32..c74cc2686911b12081c0fb715c2959e1a74316c4 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store.cc,v 1.342 1997/11/14 16:05:48 wessels Exp $
+ * $Id: store.cc,v 1.343 1997/11/14 17:22:09 wessels Exp $
  *
  * DEBUG: section 20    Storeage Manager
  * AUTHOR: Harvest Derived
@@ -1719,12 +1719,14 @@ storeClientCopy2(StoreEntry * e, store_client * sc)
     STCB *callback = sc->callback;
     MemObject *mem = e->mem_obj;
     size_t sz;
+    static int loopdetect = 0;
+    assert(++loopdetect < 3);
     debug(20, 3) ("storeClientCopy2: %s\n", storeKeyText(e->key));
     assert(callback != NULL);
     if (e->store_status == STORE_ABORTED) {
        sc->callback = NULL;
        callback(sc->callback_data, sc->copy_buf, 0);
-    } else if (e->store_status == STORE_OK && sc->copy_offset == mem->inmem_hi) {
+    } else if (e->store_status == STORE_OK && sc->copy_offset == e->object_len) {
        /* There is no more to send! */
        sc->callback = NULL;
        callback(sc->callback_data, sc->copy_buf, 0);
@@ -1749,6 +1751,7 @@ storeClientCopy2(StoreEntry * e, store_client * sc)
        assert(sc->type == STORE_DISK_CLIENT);
        storeClientCopyFileRead(sc);
     }
+    --loopdetect;
 }
 
 static void