]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Relaxed asserts because hits reading collapsed entries may have zero swap_file_sz.
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 29 Jul 2013 00:33:43 +0000 (18:33 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 29 Jul 2013 00:33:43 +0000 (18:33 -0600)
src/store_client.cc

index 8007f78700670e2c1438261f01254439b84a9d38..519c0d0e4b788398f146c6937de2a9555723d2cc 100644 (file)
@@ -597,10 +597,11 @@ store_client::unpackHeader(char const *buf, ssize_t len)
     storeSwapTLVFree(tlv_list);
 
     assert(swap_hdr_sz >= 0);
-    assert(entry->swap_file_sz > 0);
-    assert(entry->swap_file_sz >= static_cast<uint64_t>(swap_hdr_sz));
     entry->mem_obj->swap_hdr_sz = swap_hdr_sz;
-    entry->mem_obj->object_sz = entry->swap_file_sz - swap_hdr_sz;
+    if (entry->swap_file_sz > 0) { // collapsed hits may not know swap_file_sz
+        assert(entry->swap_file_sz >= static_cast<uint64_t>(swap_hdr_sz));
+        entry->mem_obj->object_sz = entry->swap_file_sz - swap_hdr_sz;
+    }
     debugs(90, 5, "store_client::unpackHeader: swap_file_sz=" <<
            entry->swap_file_sz << "( " << swap_hdr_sz << " + " <<
            entry->mem_obj->object_sz << ")");