return 0;
}
+bool
+StoreEntry::checkTooBig() const
+{
+ if (mem_obj->endOffset() > store_maxobjsize)
+ return true;
+
+ if (getReply()->content_length < 0)
+ return false;
+
+ return (getReply()->content_length > store_maxobjsize);
+}
+
// TODO: move "too many open..." checks outside -- we are called too early/late
bool
StoreEntry::checkCachable()
debugs(20, 3, "StoreEntry::checkCachable: NO: negative cached");
++store_check_cachable_hist.no.negative_cached;
return 0; /* avoid release call below */
- } else if ((getReply()->content_length > 0 &&
- getReply()->content_length > store_maxobjsize) ||
- mem_obj->endOffset() > store_maxobjsize) {
+ } else if (!mem_obj || !getReply()) {
+ // XXX: In bug 4131, we forgetHit() without mem_obj, so we need
+ // this segfault protection, but how can we get such a HIT?
+ // TODO: add store_check_cachable_hist.no.parts if this check stays
+ debugs(20, 2, "StoreEntry::checkCachable: NO: missing parts: " << *this);
+ } else if (checkTooBig()) {
debugs(20, 2, "StoreEntry::checkCachable: NO: too big");
++store_check_cachable_hist.no.too_big;
} else if (checkTooSmall()) {