]> git.ipfire.org Git - thirdparty/squid.git/blame - src/HttpHdrScTarget.cc
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / HttpHdrScTarget.cc
CommitLineData
43ae1d95 1/*
77b1029d 2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
43ae1d95 3 *
bbc27441
AJ
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
43ae1d95 7 */
8
bbc27441
AJ
9/* DEBUG: section 90 HTTP Cache Control Header */
10
582c2af2 11#include "squid.h"
b56ab9e7 12#include "HttpHdrScTarget.h"
00a7574e 13#include "StatHist.h"
43ae1d95 14
82afb125 15http_hdr_sc_type &operator++ (http_hdr_sc_type &aHeader);
43ae1d95 16/* copies non-extant fields from new_sc to this sc */
17void
45a58345 18HttpHdrScTarget::mergeWith(const HttpHdrScTarget * new_sc)
43ae1d95 19{
45a58345 20 assert(new_sc);
43ae1d95 21 /* Don't touch the target - this is used to get the operations for a
22 * single surrogate
23 */
24
45a58345
FC
25 if (new_sc->hasNoStore())
26 noStore(true);
43ae1d95 27
45a58345
FC
28 if (new_sc->hasNoStoreRemote())
29 noStoreRemote(true);
43ae1d95 30
45a58345
FC
31 if (new_sc->hasMaxAge() && !hasMaxAge()) {
32 maxAge(new_sc->maxAge());
33 maxStale(new_sc->maxStale());
34 }
43ae1d95 35
45a58345
FC
36 if (new_sc->hasContent() && !hasContent())
37 Content(new_sc->content());
43ae1d95 38
43ae1d95 39}
40
41void
45a58345 42HttpHdrScTarget::updateStats(StatHist * hist) const
43ae1d95 43{
44 http_hdr_sc_type c;
43ae1d95 45
46 for (c = SC_NO_STORE; c < SC_ENUM_END; ++c)
45a58345 47 if (isSet(c))
f30f7998 48 hist->count(c);
43ae1d95 49}
f53969cc 50