]> git.ipfire.org Git - thirdparty/squid.git/commit
Author: Alex Rousskov <rousskov@measurement-factory.com>
authorAmos Jeffries <amosjeffries@squid-cache.org>
Sat, 23 Oct 2010 13:39:03 +0000 (07:39 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Sat, 23 Oct 2010 13:39:03 +0000 (07:39 -0600)
commit3130202d6c4ba48c31587826369a6c6279d68831
tree4f9f69b3cf7a8602f5a54c53781d1d7961b416fa
parent2cc5d5c259ef9509bb7e7b1a7931c9e65a0ac8ca
Author: Alex Rousskov <rousskov@measurement-factory.com>
HTTP Compliance: add appropriate Warnings if serving a stale hit.

Per RFC 2616, we MUST add "110 Response is stale" Warning if serving a
stale reply for any reason, including configured overrides. We MUST add
"111 Revalidation failed" Warning if serving a stale reply because an
attempt to revalidate the response failed, due to an inability to reach
the server.

The patch adds a new stale_if_hit request flag, which is set in
refreshCheckHTTP() when entry freshness is calculated. refreshCheckHTTP()
is now called in offline mode, to set stale_if_hit properly. We check for
the offline mode before returning from refreshCheckHTTP() to preserve the
original logic.

refreshCheckHTTP() is no longer called for internal requests, to avoid
setting of stale_if_hit flag. It did not do anything important for
internal requests anyway.

Co-Advisor test cases:
   test_case/rfc2616/noSrv-hit-stale-max-age-req
   test_case/rfc2616/ccReqDirMsg-max-stale-warning
src/HttpHeader.cc
src/HttpHeader.h
src/client_side_reply.cc
src/refresh.cc
src/structs.h