]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not use unknown entry size in StoreEntry::checkTooSmall() determination.
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 25 Jun 2014 00:07:41 +0000 (18:07 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Wed, 25 Jun 2014 00:07:41 +0000 (18:07 -0600)
The size of collapsed entries is often unknown, even when they are STORE_OK
(because swap_hdr_sz is unknown when the other worker has created the cache
entry).  The same code has been using this ignore-unknowns logic for the
Content-Length header value, so the rejection of unknown entry size (added as
a part of C++ conversion without a dedicated message in r5766) could have been
a typo.

src/store.cc

index ff7504aa6cdcb515c9ac349f6fba05f71e67323e..7819573f5767a32a3204059c5e7de51e674a7042 100644 (file)
@@ -941,7 +941,7 @@ StoreEntry::checkTooSmall()
         return 0;
 
     if (STORE_OK == store_status)
-        if (mem_obj->object_sz < 0 ||
+        if (mem_obj->object_sz >= 0 &&
                 mem_obj->object_sz < Config.Store.minObjectSize)
             return 1;
     if (getReply()->content_length > -1)