HttpHdrScTarget.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 "HttpHdrScTarget.h"
13 #include "StatHist.h"
14 
16 /* copies non-extant fields from new_sc to this sc */
17 void
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
43 {
45 
46  for (c = SC_NO_STORE; c < SC_ENUM_END; ++c)
47  if (isSet(c))
48  hist->count(c);
49 }
50 
void maxStale(int v)
void count(double val)
Definition: StatHist.cc:57
bool hasNoStore() const
#define assert(EX)
Definition: assert.h:17
bool noStore() const
void Content(const String &v)
bool noStoreRemote() const
String content() const
bool hasMaxAge() const
void maxAge(int v)
bool isSet(http_hdr_sc_type id) const
http_hdr_sc_type & operator++(http_hdr_sc_type &aHeader)
Definition: HttpHdrSc.cc:41
bool hasNoStoreRemote() const
int maxStale() const
void updateStats(StatHist *) const
http_hdr_sc_type
Definition: HttpHdrSc.h:21
int maxAge() const
bool hasContent() const
void mergeWith(const HttpHdrScTarget *new_sc)

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors