]> git.ipfire.org Git - thirdparty/squid.git/commit - src/client_side_request.cc
Bug 3466: Adaptation stuck on last single-byte body piece
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 8 May 2012 18:14:08 +0000 (12:14 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 8 May 2012 18:14:08 +0000 (12:14 -0600)
commit4dc2b0728bd960d31b1e5efb6079a8ff96396dfd
tree74646da4d6e19ae8da36d9b8fe3cd1d8ab70b02c
parentdd332b92ede1a82099319c8cc2ff473a2c087001
Bug 3466: Adaptation stuck on last single-byte body piece

Changed StoreEntry::bytesWanted(range) to return range.end when the entry can
accommodate range.end bytes. This makes it possible to use that method for
single-byte ranges. Old code returned zero for such ranges, which was
difficult to distinguish from situations where no bytes were wanted at all.

TODO: The StoreEntry::bytesWanted(range) API is left undocumented because it
seems to be slightly broken and/or inconsistent with callers and with the
DelayId::bytesWanted(min, max) API. AFAICT, we should convert
StoreEntry::bytesWanted API from range-based to min/max-based or even just
max-based.

Store Entry API does not use the lower end of the range (except for the
now-removed assertion that the range is not empty). I suspect that Store API
was meant to be used with (first, last+1) "byte position" parameters (returning
the number of bytes wanted) while the DelayId API was meant to be used with
(min, max) "number of bytes" parameters.  However, StoreEntry::bytesWanted
implementation does not follow this assumption so perhaps my speculation is
wrong and there are more problems, including this change.
src/Server.cc
src/Store.h
src/client_side_request.cc
src/store.cc