squid-
cache.org
Optimising Web Delivery
Docs
Download
Donate
Support
About
Contact
Shop
Blog
src
HttpHdrScTarget.cc
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2022 The Squid Software Foundation and contributors
3
*
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.
7
*/
8
9
/* DEBUG: section 90 HTTP Cache Control Header */
10
11
#include "
squid.h
"
12
#include "
HttpHdrSc.h
"
13
#include "
HttpHdrScTarget.h
"
14
#include "
StatHist.h
"
15
16
/* copies non-extant fields from new_sc to this sc */
17
void
18
HttpHdrScTarget::mergeWith
(
const
HttpHdrScTarget
* new_sc)
19
{
20
assert
(new_sc);
21
/* Don't touch the target - this is used to get the operations for a
22
* single surrogate
23
*/
24
25
if
(new_sc->
hasNoStore
())
26
noStore
(
true
);
27
28
if
(new_sc->
hasNoStoreRemote
())
29
noStoreRemote
(
true
);
30
31
if
(new_sc->
hasMaxAge
() && !
hasMaxAge
()) {
32
maxAge
(new_sc->
maxAge
());
33
maxStale
(new_sc->
maxStale
());
34
}
35
36
if
(new_sc->
hasContent
() && !
hasContent
())
37
Content
(new_sc->
content
());
38
39
}
40
41
void
42
HttpHdrScTarget::updateStats
(
StatHist
* hist)
const
43
{
44
http_hdr_sc_type
c;
45
46
for
(c =
SC_NO_STORE
; c <
SC_ENUM_END
; ++c)
47
if
(
isSet
(c))
48
hist->
count
(c);
49
}
50
StatHist
Definition:
StatHist.h:26
HttpHdrScTarget::noStore
bool noStore() const
Definition:
HttpHdrScTarget.h:39
HttpHdrScTarget::mergeWith
void mergeWith(const HttpHdrScTarget *new_sc)
Definition:
HttpHdrScTarget.cc:18
SC_NO_STORE
@ SC_NO_STORE
Definition:
forward.h:32
HttpHdrScTarget::isSet
bool isSet(http_hdr_sc_type id) const
Definition:
HttpHdrScTarget.h:82
HttpHdrScTarget.h
http_hdr_sc_type
http_hdr_sc_type
Definition:
forward.h:31
HttpHdrScTarget::noStoreRemote
bool noStoreRemote() const
Definition:
HttpHdrScTarget.h:44
HttpHdrScTarget::hasNoStore
bool hasNoStore() const
Definition:
HttpHdrScTarget.h:37
StatHist.h
StatHist::count
void count(double val)
Definition:
StatHist.cc:55
assert
#define assert(EX)
Definition:
assert.h:19
SC_ENUM_END
@ SC_ENUM_END
Definition:
forward.h:37
HttpHdrScTarget
Definition:
HttpHdrScTarget.h:25
HttpHdrScTarget::content
String content() const
Definition:
HttpHdrScTarget.h:71
HttpHdrScTarget::maxAge
void maxAge(int v)
Definition:
HttpHdrScTarget.h:48
HttpHdrSc.h
HttpHdrScTarget::updateStats
void updateStats(StatHist *) const
Definition:
HttpHdrScTarget.cc:42
HttpHdrScTarget::maxAge
int maxAge() const
Definition:
HttpHdrScTarget.h:57
squid.h
HttpHdrScTarget::hasContent
bool hasContent() const
Definition:
HttpHdrScTarget.h:66
HttpHdrScTarget::Content
void Content(const String &v)
Definition:
HttpHdrScTarget.h:67
HttpHdrScTarget::maxStale
int maxStale() const
Definition:
HttpHdrScTarget.h:63
HttpHdrScTarget::hasMaxAge
bool hasMaxAge() const
Definition:
HttpHdrScTarget.h:47
HttpHdrScTarget::hasNoStoreRemote
bool hasNoStoreRemote() const
Definition:
HttpHdrScTarget.h:42
HttpHdrScTarget::maxStale
void maxStale(int v)
Definition:
HttpHdrScTarget.h:62
Introduction
About Squid
Why Squid?
Squid Developers
How to Donate
How to Help Out
Getting Squid
Squid Source Packages
Squid Deployment Case-Studies
Squid Software Foundation
Documentation
Configuration:
Reference
Examples
FAQ
and
Wiki
Guide Books:
Beginners
Definitive
Non-English
More...
Support
Security Advisories
Bugzilla Database
Mailing lists
Contacting us
Commercial services
Project Sponsors
Squid-based products
Miscellaneous
Developer Resources
Related Writings
Related Software:
Authenticators
Ecap
Icap
Ident
Log Analysis
Monitor
Proxies
Redirectors
General
Squid Artwork
Web Site Translations
Japanese
Mirrors
Website:
gr
il
jp
pl
...
full list
FTP Package Archive