#include <HttpHdrCc.h>

Collaboration diagram for HttpHdrCc:

Public Member Functions

 HttpHdrCc ()
 
void clear ()
 reset data-members to default state More...
 
bool parse (const String &s)
 parse a header-string and fill in appropriate values. More...
 
bool hasPublic () const
 
void Public (bool v)
 
void clearPublic ()
 
bool hasPrivate (const String **val=nullptr) const
 
void Private (const String &v)
 
void clearPrivate ()
 
bool hasNoCacheWithParameters () const
 
bool hasNoCacheWithoutParameters () const
 
bool hasNoCache (const String **val=nullptr) const
 
void noCache (const String &v)
 
void clearNoCache ()
 
bool hasNoStore () const
 
void noStore (bool v)
 
void clearNoStore ()
 
bool hasNoTransform () const
 
void noTransform (bool v)
 
void clearNoTransform ()
 
bool hasMustRevalidate () const
 
void mustRevalidate (bool v)
 
void clearMustRevalidate ()
 
bool hasProxyRevalidate () const
 
void proxyRevalidate (bool v)
 
void clearProxyRevalidate ()
 
bool hasMaxAge (int32_t *val=nullptr) const
 
void maxAge (int32_t v)
 
void clearMaxAge ()
 
bool hasSMaxAge (int32_t *val=nullptr) const
 
void sMaxAge (int32_t v)
 
void clearSMaxAge ()
 
bool hasMaxStale (int32_t *val=nullptr) const
 
void maxStale (int32_t v)
 
void clearMaxStale ()
 
bool hasMinFresh (int32_t *val=nullptr) const
 
void minFresh (int32_t v)
 
void clearMinFresh ()
 
bool hasOnlyIfCached () const
 
void onlyIfCached (bool v)
 
void clearOnlyIfCached ()
 
bool hasStaleIfError (int32_t *val=nullptr) const
 
void staleIfError (int32_t v)
 
void clearStaleIfError ()
 
bool hasImmutable () const
 
void Immutable (bool v)
 
void clearImmutable ()
 
bool isSet (HttpHdrCcType id) const
 check whether the attribute value supplied by id is set More...
 
void packInto (Packable *p) const
 

Public Attributes

String other
 

Static Public Attributes

static const int32_t MAX_AGE_UNKNOWN =-1
 
static const int32_t S_MAXAGE_UNKNOWN =-1
 
static const int32_t MAX_STALE_UNKNOWN =-1
 
static const int32_t MAX_STALE_ANY =0x7fffffff
 
static const int32_t STALE_IF_ERROR_UNKNOWN =-1
 
static const int32_t MIN_FRESH_UNKNOWN =-1
 

Private Member Functions

 MEMPROXY_CLASS (HttpHdrCc)
 
template<class Value >
bool hasDirective (const HttpHdrCcType hdrType, const Value &parsedVal, Value *outVal=nullptr) const
 implements typical has*() method logic More...
 
void setMask (HttpHdrCcType id, bool newval=true)
 low-level part of the public set method, performs no checks More...
 
void setValue (int32_t &value, int32_t new_value, HttpHdrCcType hdr, bool setting=true)
 

Private Attributes

int32_t mask
 
int32_t max_age
 
int32_t s_maxage
 
int32_t max_stale
 
int32_t stale_if_error
 
int32_t min_fresh
 
String private_
 List of headers sent as value for CC:private="...". May be empty/undefined if the value is missing. More...
 
String no_cache
 List of headers sent as value for CC:no-cache="...". May be empty/undefined if the value is missing. More...
 

Detailed Description

Http Cache-Control header representation

Store and parse the Cache-Control HTTP header.

Definition at line 43 of file HttpHdrCc.h.

Constructor & Destructor Documentation

◆ HttpHdrCc()

HttpHdrCc::HttpHdrCc ( )
inline

Definition at line 57 of file HttpHdrCc.h.

Referenced by clear().

Member Function Documentation

◆ clear()

void HttpHdrCc::clear ( )

Definition at line 70 of file HttpHdrCc.cc.

References HttpHdrCc().

◆ clearImmutable()

void HttpHdrCc::clearImmutable ( )
inline

Definition at line 157 of file HttpHdrCc.h.

References CC_IMMUTABLE, and setMask().

◆ clearMaxAge()

void HttpHdrCc::clearMaxAge ( )
inline

Definition at line 124 of file HttpHdrCc.h.

References CC_MAX_AGE, max_age, MAX_AGE_UNKNOWN, and setValue().

Referenced by parse().

◆ clearMaxStale()

void HttpHdrCc::clearMaxStale ( )
inline

Definition at line 137 of file HttpHdrCc.h.

References CC_MAX_STALE, max_stale, MAX_STALE_UNKNOWN, and setValue().

◆ clearMinFresh()

void HttpHdrCc::clearMinFresh ( )
inline

Definition at line 142 of file HttpHdrCc.h.

References CC_MIN_FRESH, min_fresh, MIN_FRESH_UNKNOWN, and setValue().

Referenced by parse().

◆ clearMustRevalidate()

void HttpHdrCc::clearMustRevalidate ( )
inline

Definition at line 114 of file HttpHdrCc.h.

References CC_MUST_REVALIDATE, and setMask().

◆ clearNoCache()

void HttpHdrCc::clearNoCache ( )
inline

Definition at line 99 of file HttpHdrCc.h.

References CC_NO_CACHE, String::clean(), no_cache, and setMask().

◆ clearNoStore()

void HttpHdrCc::clearNoStore ( )
inline

Definition at line 104 of file HttpHdrCc.h.

References CC_NO_STORE, and setMask().

◆ clearNoTransform()

void HttpHdrCc::clearNoTransform ( )
inline

Definition at line 109 of file HttpHdrCc.h.

References CC_NO_TRANSFORM, and setMask().

◆ clearOnlyIfCached()

void HttpHdrCc::clearOnlyIfCached ( )
inline

Definition at line 147 of file HttpHdrCc.h.

References CC_ONLY_IF_CACHED, and setMask().

◆ clearPrivate()

void HttpHdrCc::clearPrivate ( )
inline

Definition at line 84 of file HttpHdrCc.h.

References CC_PRIVATE, String::clean(), private_, and setMask().

◆ clearProxyRevalidate()

void HttpHdrCc::clearProxyRevalidate ( )
inline

Definition at line 119 of file HttpHdrCc.h.

References CC_PROXY_REVALIDATE, and setMask().

◆ clearPublic()

void HttpHdrCc::clearPublic ( )
inline

Definition at line 71 of file HttpHdrCc.h.

References CC_PUBLIC, and setMask().

◆ clearSMaxAge()

void HttpHdrCc::clearSMaxAge ( )
inline

Definition at line 129 of file HttpHdrCc.h.

References CC_S_MAXAGE, MAX_AGE_UNKNOWN, s_maxage, and setValue().

Referenced by parse().

◆ clearStaleIfError()

void HttpHdrCc::clearStaleIfError ( )
inline

Definition at line 152 of file HttpHdrCc.h.

References CC_STALE_IF_ERROR, setValue(), stale_if_error, and STALE_IF_ERROR_UNKNOWN.

Referenced by parse().

◆ hasDirective()

template<class Value >
bool HttpHdrCc::hasDirective ( const HttpHdrCcType  hdrType,
const Value &  parsedVal,
Value *  outVal = nullptr 
) const
inlineprivate

Definition at line 184 of file HttpHdrCc.h.

References isSet().

Referenced by hasMaxAge(), hasMaxStale(), hasMinFresh(), hasNoCache(), hasPrivate(), hasSMaxAge(), and hasStaleIfError().

◆ hasImmutable()

bool HttpHdrCc::hasImmutable ( ) const
inline

Definition at line 155 of file HttpHdrCc.h.

References CC_IMMUTABLE, and isSet().

◆ hasMaxAge()

bool HttpHdrCc::hasMaxAge ( int32_t *  val = nullptr) const
inline

◆ hasMaxStale()

bool HttpHdrCc::hasMaxStale ( int32_t *  val = nullptr) const
inline

Definition at line 132 of file HttpHdrCc.h.

References CC_MAX_STALE, hasDirective(), and max_stale.

Referenced by refreshCheck().

◆ hasMinFresh()

bool HttpHdrCc::hasMinFresh ( int32_t *  val = nullptr) const
inline

Definition at line 140 of file HttpHdrCc.h.

References CC_MIN_FRESH, hasDirective(), and min_fresh.

Referenced by refreshCheck().

◆ hasMustRevalidate()

bool HttpHdrCc::hasMustRevalidate ( ) const
inline

Definition at line 112 of file HttpHdrCc.h.

References CC_MUST_REVALIDATE, and isSet().

Referenced by HttpStateData::haveParsedReplyHeaders(), and HttpStateData::reusableReply().

◆ hasNoCache()

bool HttpHdrCc::hasNoCache ( const String **  val = nullptr) const
inline

◆ hasNoCacheWithoutParameters()

bool HttpHdrCc::hasNoCacheWithoutParameters ( ) const
inline

◆ hasNoCacheWithParameters()

bool HttpHdrCc::hasNoCacheWithParameters ( ) const
inline

Definition at line 87 of file HttpHdrCc.h.

References hasNoCache(), no_cache, and String::size().

Referenced by HttpStateData::reusableReply().

◆ hasNoStore()

bool HttpHdrCc::hasNoStore ( ) const
inline

Definition at line 102 of file HttpHdrCc.h.

References CC_NO_STORE, and isSet().

Referenced by HttpRequest::maybeCacheable(), and HttpStateData::reusableReply().

◆ hasNoTransform()

bool HttpHdrCc::hasNoTransform ( ) const
inline

Definition at line 107 of file HttpHdrCc.h.

References CC_NO_TRANSFORM, and isSet().

◆ hasOnlyIfCached()

bool HttpHdrCc::hasOnlyIfCached ( ) const
inline

Definition at line 145 of file HttpHdrCc.h.

References CC_ONLY_IF_CACHED, and isSet().

Referenced by ClientHttpRequest::onlyIfCached().

◆ hasPrivate()

bool HttpHdrCc::hasPrivate ( const String **  val = nullptr) const
inline

◆ hasProxyRevalidate()

bool HttpHdrCc::hasProxyRevalidate ( ) const
inline

Definition at line 117 of file HttpHdrCc.h.

References CC_PROXY_REVALIDATE, and isSet().

Referenced by HttpStateData::haveParsedReplyHeaders().

◆ hasPublic()

bool HttpHdrCc::hasPublic ( ) const
inline

Definition at line 69 of file HttpHdrCc.h.

References CC_PUBLIC, and isSet().

Referenced by HttpStateData::reusableReply().

◆ hasSMaxAge()

bool HttpHdrCc::hasSMaxAge ( int32_t *  val = nullptr) const
inline

◆ hasStaleIfError()

bool HttpHdrCc::hasStaleIfError ( int32_t *  val = nullptr) const
inline

Definition at line 150 of file HttpHdrCc.h.

References CC_STALE_IF_ERROR, hasDirective(), and stale_if_error.

Referenced by refreshCheck().

◆ Immutable()

void HttpHdrCc::Immutable ( bool  v)
inline

Definition at line 156 of file HttpHdrCc.h.

References CC_IMMUTABLE, and setMask().

Referenced by parse().

◆ isSet()

◆ maxAge()

void HttpHdrCc::maxAge ( int32_t  v)
inline

Definition at line 123 of file HttpHdrCc.h.

References CC_MAX_AGE, max_age, and setValue().

Referenced by HttpStateData::httpBuildRequestHeader(), and MimeIcon::load().

◆ maxStale()

void HttpHdrCc::maxStale ( int32_t  v)
inline

Definition at line 136 of file HttpHdrCc.h.

References CC_MAX_STALE, max_stale, and setValue().

Referenced by parse().

◆ MEMPROXY_CLASS()

HttpHdrCc::MEMPROXY_CLASS ( HttpHdrCc  )
private

◆ minFresh()

void HttpHdrCc::minFresh ( int32_t  v)
inline

Definition at line 141 of file HttpHdrCc.h.

References CC_MIN_FRESH, min_fresh, and setValue().

◆ mustRevalidate()

void HttpHdrCc::mustRevalidate ( bool  v)
inline

Definition at line 113 of file HttpHdrCc.h.

References CC_MUST_REVALIDATE, and setMask().

Referenced by parse().

◆ noCache()

void HttpHdrCc::noCache ( const String v)
inline

◆ noStore()

void HttpHdrCc::noStore ( bool  v)
inline

Definition at line 103 of file HttpHdrCc.h.

References CC_NO_STORE, and setMask().

Referenced by parse(), and CacheManager::PutCommonResponseHeaders().

◆ noTransform()

void HttpHdrCc::noTransform ( bool  v)
inline

Definition at line 108 of file HttpHdrCc.h.

References CC_NO_TRANSFORM, and setMask().

Referenced by parse().

◆ onlyIfCached()

void HttpHdrCc::onlyIfCached ( bool  v)
inline

Definition at line 146 of file HttpHdrCc.h.

References CC_ONLY_IF_CACHED, and setMask().

Referenced by HttpStateData::httpBuildRequestHeader(), and parse().

◆ packInto()

◆ parse()

◆ Private()

void HttpHdrCc::Private ( const String v)
inline

Definition at line 75 of file HttpHdrCc.h.

References String::append(), CC_PRIVATE, private_, setMask(), and String::size().

Referenced by Ftp::HttpReplyWrapper().

◆ proxyRevalidate()

void HttpHdrCc::proxyRevalidate ( bool  v)
inline

Definition at line 118 of file HttpHdrCc.h.

References CC_PROXY_REVALIDATE, and setMask().

Referenced by parse().

◆ Public()

void HttpHdrCc::Public ( bool  v)
inline

Definition at line 70 of file HttpHdrCc.h.

References CC_PUBLIC, and setMask().

Referenced by parse().

◆ setMask()

◆ setValue()

void HttpHdrCc::setValue ( int32_t &  value,
int32_t  new_value,
HttpHdrCcType  hdr,
bool  setting = true 
)
private

set a data member to a new value, and set the corresponding mask-bit. if setting is false, then the mask-bit is cleared.

Definition at line 78 of file HttpHdrCc.cc.

References debugs, and setMask().

Referenced by clearMaxAge(), clearMaxStale(), clearMinFresh(), clearSMaxAge(), clearStaleIfError(), maxAge(), maxStale(), minFresh(), sMaxAge(), and staleIfError().

◆ sMaxAge()

void HttpHdrCc::sMaxAge ( int32_t  v)
inline

Definition at line 128 of file HttpHdrCc.h.

References CC_S_MAXAGE, s_maxage, and setValue().

◆ staleIfError()

void HttpHdrCc::staleIfError ( int32_t  v)
inline

Definition at line 151 of file HttpHdrCc.h.

References CC_STALE_IF_ERROR, setValue(), and stale_if_error.

Member Data Documentation

◆ mask

int32_t HttpHdrCc::mask
private

bit-mask representing what header values are set among those recognized by squid.

managed via EBIT_SET/TEST/CLR

Definition at line 173 of file HttpHdrCc.h.

Referenced by isSet(), packInto(), parse(), and setMask().

◆ max_age

int32_t HttpHdrCc::max_age
private

Definition at line 174 of file HttpHdrCc.h.

Referenced by clearMaxAge(), hasMaxAge(), maxAge(), packInto(), and parse().

◆ MAX_AGE_UNKNOWN

const int32_t HttpHdrCc::MAX_AGE_UNKNOWN =-1
static

Definition at line 48 of file HttpHdrCc.h.

Referenced by clearMaxAge(), and clearSMaxAge().

◆ max_stale

int32_t HttpHdrCc::max_stale
private

Definition at line 176 of file HttpHdrCc.h.

Referenced by clearMaxStale(), hasMaxStale(), maxStale(), packInto(), and parse().

◆ MAX_STALE_ANY

const int32_t HttpHdrCc::MAX_STALE_ANY =0x7fffffff
static

used to mark a valueless Cache-Control: max-stale directive, which instructs us to treat responses of any age as fresh

Definition at line 53 of file HttpHdrCc.h.

Referenced by packInto(), parse(), and refreshCheck().

◆ MAX_STALE_UNKNOWN

const int32_t HttpHdrCc::MAX_STALE_UNKNOWN =-1
static

Definition at line 50 of file HttpHdrCc.h.

Referenced by clearMaxStale().

◆ min_fresh

int32_t HttpHdrCc::min_fresh
private

Definition at line 178 of file HttpHdrCc.h.

Referenced by clearMinFresh(), hasMinFresh(), minFresh(), packInto(), and parse().

◆ MIN_FRESH_UNKNOWN

const int32_t HttpHdrCc::MIN_FRESH_UNKNOWN =-1
static

Definition at line 55 of file HttpHdrCc.h.

Referenced by clearMinFresh().

◆ no_cache

String HttpHdrCc::no_cache
private

◆ other

String HttpHdrCc::other

comma-separated representation of the header values which were received but are not recognized.

Definition at line 207 of file HttpHdrCc.h.

Referenced by packInto(), and parse().

◆ private_

String HttpHdrCc::private_
private

Definition at line 179 of file HttpHdrCc.h.

Referenced by clearPrivate(), hasPrivate(), packInto(), parse(), and Private().

◆ s_maxage

int32_t HttpHdrCc::s_maxage
private

Definition at line 175 of file HttpHdrCc.h.

Referenced by clearSMaxAge(), hasSMaxAge(), packInto(), parse(), and sMaxAge().

◆ S_MAXAGE_UNKNOWN

const int32_t HttpHdrCc::S_MAXAGE_UNKNOWN =-1
static

Definition at line 49 of file HttpHdrCc.h.

◆ stale_if_error

int32_t HttpHdrCc::stale_if_error
private

Definition at line 177 of file HttpHdrCc.h.

Referenced by clearStaleIfError(), hasStaleIfError(), packInto(), parse(), and staleIfError().

◆ STALE_IF_ERROR_UNKNOWN

const int32_t HttpHdrCc::STALE_IF_ERROR_UNKNOWN =-1
static

Definition at line 54 of file HttpHdrCc.h.

Referenced by clearStaleIfError().


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors