42 int tmp =
static_cast<int>(aHeader);
51 for (
int i = 0;
ScAttrs[i].name !=
nullptr; ++i)
63 if (!sc->
parse(&str)) {
78 const char *pos =
nullptr;
79 const char *target =
nullptr;
80 const char *temp =
nullptr;
94 if ((p = strchr(item,
'=')) && (p - item < ilen)) {
95 vlen = ilen - (p + 1 - item);
101 else if ((p = strchr(item,
';')) && (p - item < ilen)) {
110 debugs(90, 2,
"unknown control-directive near '" << item <<
"' in '" << *str <<
"'");
116 temp =
xstrndup (item, initiallen + 1);
118 if (!((target = strrchr (temp,
';')) && !strchr (target,
'"') && *(target + 1) !=
'\0'))
128 sct = &
targets.emplace_front(target);
133 if (sct->
isSet(type)) {
135 debugs(90, 2,
"ignoring duplicate control-directive near '" << item <<
"' in '" << *str <<
"'");
154 if ((p = strchr (p,
'+'))) {
160 debugs(90, 2,
"sc: invalid max-stale specs near '" << item <<
"'");
166 debugs(90, 2,
"sc: invalid max-age specs near '" << item <<
"'");
178 debugs(90, 2,
"sc: invalid content= quoted string near '" << item <<
"'");
226 for (
const auto &t :
targets) {
238 sct = &
targets.emplace_back(target);
256 const int id = (
int) val;
258 const char *name = valid_id ?
ScAttrs[id].name :
"INVALID";
260 if (count || valid_id)
269 const int id = (
int) val;
271 const char *name = valid_id ?
ScAttrs[id].name :
"INVALID";
273 if (count || valid_id)
282 if (sct.target.cmp(target) == 0)
305 if (sctgeneric || sctus) {
void httpHdrScStatDumper(StoreEntry *sentry, int, double val, double, int count)
http_hdr_sc_type & operator++(http_hdr_sc_type &aHeader)
LookupTable< http_hdr_sc_type > scLookupTable(SC_ENUM_END, ScAttrs)
void httpHdrScTargetStatDumper(StoreEntry *sentry, int, double val, double, int count)
static const LookupTable< http_hdr_sc_type >::Record ScAttrs[]
HttpHdrSc * httpHdrScParseCreate(const String &str)
void httpHdrScInitModule(void)
#define SQUIDSTRINGPRINT(s)
int strListGetItem(const String *str, char del, const char **item, int *ilen, const char **pos)
bool isSet(http_hdr_sc_type id) const
void mergeWith(const HttpHdrScTarget *new_sc)
void setMask(http_hdr_sc_type id, bool newval)
void packInto(Packable *p) const
XXX: this function should be in HttpHdrScTarget.cc.
void noStoreRemote(bool v)
void setMaxAge(char const *target, int max_age)
void packInto(Packable *p) const
HttpHdrScTarget * findTarget(const char *target)
std::list< HttpHdrScTarget, PoolingAllocator< HttpHdrScTarget > > targets
HttpHdrScTarget * getMergedTarget(const char *ourtarget)
bool parse(const String *str)
void updateStats(StatHist *) const
void appendf(const char *fmt,...) PRINTF_FORMAT_ARG2
Append operation with printf-style arguments.
#define debugs(SECTION, LEVEL, CONTENT)
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
double xdiv(double nom, double denom)
char * xstrndup(const char *s, size_t n)