hno [Thu, 8 Jun 2006 04:39:33 +0000 (04:39 +0000)]
Bug #1548: Cleanup of 304 processing
by Doug Dixon <doug.dixon@gmail.com>
The main change is to the logging codes. Since all refreshes hit the origin, it
does not make any sense to refer to them as HIT or MISS. Instead, they have
been renamed to describe the result from the origin server:
* TCP_REFRESH_UNMODIFIED - The requested object was cached but STALE. The IMS
query for the object resulted in "304 not modified".
* TCP_REFRESH_FAIL - The requested object was cached but STALE. The IMS query
failed and the stale object was delivered.
* TCP_REFRESH_MODIFIED - The requested object was cached but STALE. The IMS
query returned the new content.
These actually fit the FAQ now (if you change the names):
http://www.squid-cache.org/Doc/FAQ/FAQ-6.html#ss6.7
Apart from that:
1. I've corrected the set of headers that should NOT be updated in an existing
cache entry on receipt of a 304 from the origin (i.e. hop-by-hop headers)
2. I've removed a couple more functions and put the code inline. It's easier to
follow.
only allowing the entity-headers specified as being cool for 304
(section 10.3.5) to update an entry:
Content-Location
Expires
All the other entity-headers are either a SHOULD NOT or MUST NOT for including
with a 304 anyway, so always ignore these when updating an entry:
hno [Wed, 7 Jun 2006 01:22:13 +0000 (01:22 +0000)]
Bug #624: Various assertion errors on Range requests
use reply range spec if does not match request range spec (forward as-is)
This assertion is triggered if request range is not satisified by reply. In
this case, we simply forward the reply as-is.
To forward as-is, we override client_side reply range spec with server_side
reply range spec.
if reply has ranges but request is not: we forward as-is.
Another situation where this assertion is triggered: if reply is partial
content (status 206) but request is not. This patch forward as-is the
offending response received on server_side.
This assertion was traced to bugs in UFSStoreState code when using aufs
storage. The primary problem was that UFSStoreState was aggressive
in closing swapout files. They could be closed before any I/Os had
time to complete. The assertion seemed to be caused by a "double
callback" whereby memNodeWriteComplete would get called twice.
Additionally, writes were executed out-of-order in cases where a
write was placed on the pending queue because open hadn't completed
yet. A subsequent write would be given priority even though
the first write was in the pending queue.
Now all writes go into the pending queue. This sucks a little bit,
especially for synchronous storage shcemes such as UFS and cases
where UFSStoreState gets one write request at a time and queueing
is unnecessary.
See additional comments in fs/ufs/store_io_ufs.cc dated 2006-05-24
wessels [Wed, 31 May 2006 03:15:58 +0000 (03:15 +0000)]
Removed comm_accept_check_event() and related code since we have
the AcceptLimiter class which does a better job of deferring new
connections when we start to run out of FDs.
hno [Tue, 30 May 2006 23:31:23 +0000 (23:31 +0000)]
Bug #1554: HTCP RFC compliance
Fix field order to comply with the RFC. Bump minor version to 1 to
make migration easier. New cache-peer option to support old Squid HTCP
implementaitons.
robertc [Mon, 29 May 2006 06:14:59 +0000 (06:14 +0000)]
Add a CacheManager class which provides the cachemanager menu registration facility, and remove all compile time dependencies upon cachemgrRegister from squid outside of main.cc. This allows much simpler tests, as modules exporting cache mgr information no longer drag in all of squid via cache_manager.cc.
wessels [Sat, 27 May 2006 01:58:37 +0000 (01:58 +0000)]
cosmetic: The debug message "WARNING! Your cache is running out of
filedescriptors" appears in two places. I changed it to debugs()
macro with HERE argument to differentiate the two messages.
wessels [Wed, 24 May 2006 00:24:41 +0000 (00:24 +0000)]
Fix NULL pointer access with asyncio when Squid starts up over the disk
space limit.
We used to call squidaio_init() from DiskThreadsDiskFile::operator new.
But this only gets called when opening a file. If the first transaction
is to unlink a file, squidaio will be uninitialized.
I didn't see any other good places to call squidaio_init(). For now
I am calling it from within the squidaio module itself at the
start of each open, unlink/truncate, and stat call.