]>
Commit | Line | Data |
---|---|---|
43ae1d95 | 1 | |
2 | /* | |
262a0e14 | 3 | * $Id$ |
43ae1d95 | 4 | * |
5 | * DEBUG: section 90 HTTP Cache Control Header | |
6 | * AUTHOR: Alex Rousskov | |
7 | * Robert Collins (Surrogate-Control is derived from | |
8 | * Cache-Control). | |
9 | * | |
10 | * SQUID Web Proxy Cache http://www.squid-cache.org/ | |
11 | * ---------------------------------------------------------- | |
12 | * | |
13 | * Squid is the result of efforts by numerous individuals from | |
14 | * the Internet community; see the CONTRIBUTORS file for full | |
15 | * details. Many organizations have provided support for Squid's | |
16 | * development; see the SPONSORS file for full details. Squid is | |
17 | * Copyrighted (C) 2001 by the Regents of the University of | |
18 | * California; see the COPYRIGHT file for full details. Squid | |
19 | * incorporates software developed and/or copyrighted by other | |
20 | * sources; see the CREDITS file for full details. | |
21 | * | |
22 | * This program is free software; you can redistribute it and/or modify | |
23 | * it under the terms of the GNU General Public License as published by | |
24 | * the Free Software Foundation; either version 2 of the License, or | |
25 | * (at your option) any later version. | |
26ac0430 | 26 | * |
43ae1d95 | 27 | * This program is distributed in the hope that it will be useful, |
28 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
29 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
30 | * GNU General Public License for more details. | |
26ac0430 | 31 | * |
43ae1d95 | 32 | * You should have received a copy of the GNU General Public License |
33 | * along with this program; if not, write to the Free Software | |
34 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. | |
35 | * | |
36 | */ | |
37 | ||
f7f3304a | 38 | #include "squid-old.h" |
25b6a907 | 39 | #include "HttpHdrSc.h" |
00a7574e | 40 | #include "StatHist.h" |
43ae1d95 | 41 | |
43ae1d95 | 42 | extern http_hdr_sc_type &operator++ (http_hdr_sc_type &aHeader); |
43ae1d95 | 43 | /* copies non-extant fields from new_sc to this sc */ |
44 | void | |
45a58345 | 45 | HttpHdrScTarget::mergeWith(const HttpHdrScTarget * new_sc) |
43ae1d95 | 46 | { |
45a58345 | 47 | assert(new_sc); |
43ae1d95 | 48 | /* Don't touch the target - this is used to get the operations for a |
49 | * single surrogate | |
50 | */ | |
51 | ||
45a58345 FC |
52 | if (new_sc->hasNoStore()) |
53 | noStore(true); | |
43ae1d95 | 54 | |
45a58345 FC |
55 | if (new_sc->hasNoStoreRemote()) |
56 | noStoreRemote(true); | |
43ae1d95 | 57 | |
45a58345 FC |
58 | if (new_sc->hasMaxAge() && !hasMaxAge()) { |
59 | maxAge(new_sc->maxAge()); | |
60 | maxStale(new_sc->maxStale()); | |
61 | } | |
43ae1d95 | 62 | |
45a58345 FC |
63 | if (new_sc->hasContent() && !hasContent()) |
64 | Content(new_sc->content()); | |
43ae1d95 | 65 | |
43ae1d95 | 66 | } |
67 | ||
68 | void | |
45a58345 | 69 | HttpHdrScTarget::updateStats(StatHist * hist) const |
43ae1d95 | 70 | { |
71 | http_hdr_sc_type c; | |
43ae1d95 | 72 | |
73 | for (c = SC_NO_STORE; c < SC_ENUM_END; ++c) | |
45a58345 | 74 | if (isSet(c)) |
f30f7998 | 75 | hist->count(c); |
43ae1d95 | 76 | } |