]> git.ipfire.org Git - thirdparty/squid.git/commit
HTTP Compliance: add appropriate Warnings if serving a stale hit.
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 4 Oct 2010 15:16:18 +0000 (09:16 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Mon, 4 Oct 2010 15:16:18 +0000 (09:16 -0600)
commitbcfba8bd89bfb643ccc0e1d4a7b0e610648d884a
treeef5241847188a0e79003cb40829581b40a7807ac
parent52ed047a82bb543fda92591d359d17840de4412d
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