]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not check 'reply content_length is too big' condition twice.
authorAlex Rousskov <rousskov@measurement-factory.com>
Sun, 14 Oct 2012 00:13:18 +0000 (18:13 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 14 Oct 2012 00:13:18 +0000 (18:13 -0600)
Saves a few CPU cycles. No visible runtime effects are expected.

The semi-duplicate check was introduced in trunk r4410 while trying to
prevent huge objects from being swapped out. It is not clear to me why
that change helped at the time (but it could have something to do with
negative content_length values and their effect on then-current size
types).

src/store.cc

index b05a2ebd847d9120598eac2e81aae39f393c9fd0..91fc190f0c35e20b00d8136e21e2e9a36b46785b 100644 (file)
@@ -993,9 +993,6 @@ StoreEntry::checkCachable()
                    mem_obj->endOffset() > Config.Store.maxObjectSize) {
             debugs(20, 2, "StoreEntry::checkCachable: NO: too big");
             ++store_check_cachable_hist.no.too_big;
-        } else if (getReply()->content_length > Config.Store.maxObjectSize) {
-            debugs(20, 2, "StoreEntry::checkCachable: NO: too big");
-            ++store_check_cachable_hist.no.too_big;
         } else if (checkTooSmall()) {
             debugs(20, 2, "StoreEntry::checkCachable: NO: too small");
             ++store_check_cachable_hist.no.too_small;