52 ConstexprForEnum<HttpHdrCcType::CC_PUBLIC, HttpHdrCcType::CC_ENUM_END>([](
const auto ev) {
53 const auto idx =
static_cast<std::underlying_type<HttpHdrCcType>::type
>(ev);
65 return table->lookup(name);
70template <
typename RawId>
71static std::optional<const char *>
76 const auto idx =
static_cast<std::underlying_type<HttpHdrCcType>::type
>(rawId);
86 int tmp = (
int)aHeader;
104 debugs(65, 3,
"rejecting negative-value Cache-Control directive " << hdr
105 <<
" value " << new_value);
121 const char *pos =
nullptr;
130 if ((p = (
const char *)memchr(item,
'=', ilen)) && (p - item < ilen)) {
143 debugs(65, 2,
"hdr cc: ignoring duplicate cache-directive: near '" << item <<
"' in '" << str <<
"'");
153 debugs(65, 2,
"cc: invalid max-age specs near '" << item <<
"'");
162 debugs(65, 2,
"cc: invalid s-maxage specs near '" << item <<
"'");
171 debugs(65, 2,
"cc: max-stale directive is valid without value");
180 debugs(65, 2,
"cc: invalid min-fresh specs near '" << item <<
"'");
189 debugs(65, 2,
"cc: invalid stale-if-error specs near '" << item <<
"'");
204 debugs(65, 2,
"cc: invalid private= specs near '" << item <<
"'");
224 debugs(65, 2,
"cc: invalid no-cache= specs near '" << item <<
"'");
355 const int id =
static_cast<int>(val);
365 s <<
ccNameByType(c).value_or(
"INVALID") <<
'[' <<
static_cast<int>(c) <<
']';
void httpHdrCcUpdateStats(const HttpHdrCc *cc, StatHist *hist)
static auto ccTypeByName(const SBuf &name)
constexpr LookupTable< HttpHdrCcType >::Record attrsList[]
std::ostream & operator<<(std::ostream &s, HttpHdrCcType c)
static std::optional< const char * > ccNameByType(const RawId rawId)
void httpHdrCcStatDumper(StoreEntry *sentry, int, double val, double, int count)
constexpr const auto & CcAttrs()
static HttpHdrCcType & operator++(HttpHdrCcType &aHeader)
used to walk a table of http_header_cc_type structs
constexpr bool Less(const A a, const B b)
whether integer a is less than integer b, with correct overflow handling
#define SQUIDSTRINGPRINT(s)
int strListGetItem(const String *str, char del, const char **item, int *ilen, const char **pos)
void clear()
reset data-members to default state
String no_cache
List of headers sent as value for CC:no-cache="...". May be empty/undefined if the value is missing.
void mustRevalidate(bool v)
void setMask(HttpHdrCcType id, bool newval=true)
low-level part of the public set method, performs no checks
bool parse(const String &s)
parse a header-string and fill in appropriate values.
bool isSet(HttpHdrCcType id) const
check whether the attribute value supplied by id is set
String private_
List of headers sent as value for CC:private="...". May be empty/undefined if the value is missing.
void onlyIfCached(bool v)
static const int32_t MAX_STALE_ANY
void setValue(int32_t &value, int32_t new_value, HttpHdrCcType hdr, bool setting=true)
void proxyRevalidate(bool v)
void packInto(Packable *p) const
void appendf(const char *fmt,...) PRINTF_FORMAT_ARG2
Append operation with printf-style arguments.
void append(char const *buf, int len)
#define debugs(SECTION, LEVEL, CONTENT)
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
double xdiv(double nom, double denom)