}
int
-MemObject::mostBytesWanted(int max) const
+MemObject::mostBytesWanted(int max, bool ignoreDelayPools) const
{
#if DELAY_POOLS
- /* identify delay id with largest allowance */
- DelayId largestAllowance = mostBytesAllowed ();
- return largestAllowance.bytesWanted(0, max);
-#else
+ if (!ignoreDelayPools) {
+ /* identify delay id with largest allowance */
+ DelayId largestAllowance = mostBytesAllowed ();
+ return largestAllowance.bytesWanted(0, max);
+ }
+#endif
return max;
-#endif
}
void
void trimSwappable();
void trimUnSwappable();
bool isContiguous() const;
- int mostBytesWanted(int max) const;
+ int mostBytesWanted(int max, bool ignoreDelayPools) const;
void setNoDelay(bool const newValue);
#if DELAY_POOLS
if (!contentSize)
return; // XXX: bytesWanted asserts on zero-size ranges
- const size_t spaceAvailable = entry->bytesWanted(Range<size_t>(0, contentSize));
+ const size_t spaceAvailable = entry->bytesWanted(Range<size_t>(0, contentSize), true);
if (spaceAvailable < contentSize ) {
// No or partial body data consuming
virtual void write (StoreIOBuffer);
virtual _SQUID_INLINE_ bool isEmpty() const;
virtual bool isAccepting() const;
- virtual size_t bytesWanted(Range<size_t> const) const;
+ virtual size_t bytesWanted(Range<size_t> const aRange, bool ignoreDelayPool = false) const;
virtual void complete();
virtual store_client_t storeClientType() const;
virtual char const *getSerialisedMetaData();
bool isEmpty () const {return true;}
- virtual size_t bytesWanted(Range<size_t> const aRange) const { return aRange.end; }
+ virtual size_t bytesWanted(Range<size_t> const aRange, bool ignoreDelayPool = false) const { return aRange.end; }
void operator delete(void *address);
void complete() {}
}
size_t
-StoreEntry::bytesWanted (Range<size_t> const aRange) const
+StoreEntry::bytesWanted (Range<size_t> const aRange, bool ignoreDelayPools) const
{
if (mem_obj == NULL)
return aRange.end;
#endif
- /* Always read *something* here - we haven't got the header yet */
- if (EBIT_TEST(flags, ENTRY_FWD_HDR_WAIT))
- return aRange.end;
-
if (!mem_obj->readAheadPolicyCanRead())
return 0;
- return mem_obj->mostBytesWanted(aRange.end);
+ return mem_obj->mostBytesWanted(aRange.end, ignoreDelayPools);
}
bool
fatal ("Not implemented");
}
-int
-MemObject::mostBytesWanted(int max) const
-{
- fatal ("Not implemented");
- return -1;
-}
+int MemObject::mostBytesWanted(int max, bool ignoreDelayPools) const STUB_RETVAL(-1)
#if DELAY_POOLS
DelayId
HttpReply const *StoreEntry::getReply() const STUB_RETVAL(NULL)
void StoreEntry::write(StoreIOBuffer) STUB
bool StoreEntry::isAccepting() const STUB_RETVAL(false)
-size_t StoreEntry::bytesWanted(Range<size_t> const) const STUB_RETVAL(0)
+size_t StoreEntry::bytesWanted(Range<size_t> const, bool) const STUB_RETVAL(0)
void StoreEntry::complete() STUB
store_client_t StoreEntry::storeClientType() const STUB_RETVAL(STORE_NON_CLIENT)
char const *StoreEntry::getSerialisedMetaData() STUB_RETVAL(NULL)