]> git.ipfire.org Git - thirdparty/squid.git/commit
DelayId::operator bool() should account for cache_peer no-delay (#2121)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Sat, 19 Jul 2025 20:48:12 +0000 (20:48 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Mon, 21 Jul 2025 19:39:41 +0000 (19:39 +0000)
commitb5fb75e174b79ac0ba7a6c4942934185f23fd6c1
treebce05c6d74f230d7ec3db5aa62c67c22994b4cb3
parent7704fc9a77a5ed7ce613e0db5bbe1d2baee5181c
DelayId::operator bool() should account for cache_peer no-delay (#2121)

Without this check, a DelayId::operator bool() caller could incorrectly
limit reading from a cache_peer that has been configured to ignore delay
pools. Luckily, all existing code paths that use this operator checked
the markedAsNoDelay flag, avoiding this problem:

* DelayId::bytesWanted() and DelayId::bytesIn() checked markedAsNoDelay.

* While MemObject::delayRead() itself did not check markedAsNoDelay, the
  method is not called when markedAsNoDelay is true. The analysis of the
  corresponding code paths is complex, especially for HttpStateData! We
  also call expensive mostBytesAllowed() several times on these paths.
  Refactoring this code is outside this API safety improvement scope.

This change helps avoid accidental/unwanted read delays during future
code changes.
src/DelayId.cc
src/DelayId.h