]>
Commit | Line | Data |
---|---|---|
43ae1d95 | 1 | /* |
b8ae064d | 2 | * Copyright (C) 1996-2023 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" |
8b082ed9 | 12 | #include "HttpHdrSc.h" |
b56ab9e7 | 13 | #include "HttpHdrScTarget.h" |
00a7574e | 14 | #include "StatHist.h" |
43ae1d95 | 15 | |
43ae1d95 | 16 | /* copies non-extant fields from new_sc to this sc */ |
17 | void | |
45a58345 | 18 | HttpHdrScTarget::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 | ||
41 | void | |
45a58345 | 42 | HttpHdrScTarget::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 |