]> git.ipfire.org Git - thirdparty/squid.git/commit
mem_hdr::hasContigousContentRange() should return true for empty ranges
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 15 Feb 2013 18:12:40 +0000 (11:12 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 15 Feb 2013 18:12:40 +0000 (11:12 -0700)
commit9cc44692ae5ad980e1f8474544e79886d5695257
treee9b0731b23af731f66a6689a79824b493b11e9cb
parent09f0985d759b9ba9d6d300d43efcb2ba2e01244f
mem_hdr::hasContigousContentRange() should return true for empty ranges

mem_hdr::hasContigousContentRange() is called exclusively from
StoreEntry::mayStartSwapOut() via memObject::isContiguous(). In theory, that
mayStartSwapOut() may happen when we have not written anything to mem_hdr yet
(not even HTTP response headers). In that case, mayStartSwapout() should not
refuse to swap the entry out on non-contiguous grounds, but it was doing that
because hasContigousContentRange() mishandled the empty range case.

XXX: Calling hasContigousContentRange() [just] from mayStartSwapout() is just
wrong because what may be contiguous now may become fragmented later.
src/stmem.cc