SQUIDSTRINGPRINT(cc->other));
}
-/* negative max_age will clean old max_Age setting */
void
-httpHdrCcSetMaxAge(HttpHdrCc * cc, int max_age)
+HttpHdrCc::setMaxAge(int max_age_)
{
- assert(cc);
- cc->max_age = max_age;
+ max_age = max_age_;
- if (max_age >= 0)
- EBIT_SET(cc->mask, CC_MAX_AGE);
+ if (max_age_ >= 0)
+ EBIT_SET(mask, CC_MAX_AGE);
else
- EBIT_CLR(cc->mask, CC_MAX_AGE);
+ EBIT_CLR(mask, CC_MAX_AGE);
}
-/* negative s_maxage will clean old s-maxage setting */
void
-httpHdrCcSetSMaxAge(HttpHdrCc * cc, int s_maxage)
+HttpHdrCc::setSMaxAge(int s_maxage_)
{
- assert(cc);
- cc->s_maxage = s_maxage;
+ s_maxage = s_maxage_;
- if (s_maxage >= 0)
- EBIT_SET(cc->mask, CC_S_MAXAGE);
+ if (s_maxage_ >= 0)
+ EBIT_SET(mask, CC_S_MAXAGE);
else
- EBIT_CLR(cc->mask, CC_S_MAXAGE);
+ EBIT_CLR(mask, CC_S_MAXAGE);
}
void
min_fresh(min_fresh_) {}
/// (re)initialize by parsing the supplied Cache-control header string
bool parseInit(const String &s);
+ /** set the max_age value
+ *
+ * \param max_age the new max age. Values <0 clear it.
+ */
+ void setMaxAge(int32_t max_age);
+
+ /** set the s-maxage
+ *
+ * \param s_maxage the new max age. Values <0 clear it.
+ */
+ void setSMaxAge(int32_t s_maxage);
MEMPROXY_CLASS(HttpHdrCc);
if (!EBIT_TEST(cc->mask, CC_MAX_AGE) && !EBIT_TEST(cc->mask, CC_NO_CACHE)) {
const char *url =
entry ? entry->url() : urlCanonical(request);
- httpHdrCcSetMaxAge(cc, getMaxAge(url));
+ cc->setMaxAge(getMaxAge(url));
}
reply->cache_control = new HttpHdrCc();
- httpHdrCcSetMaxAge(reply->cache_control, 86400);
+ reply->cache_control->setMaxAge(86400);
reply->header.putCc(reply->cache_control);
SQUIDCEXTERN void httpHdrCcCleanModule(void);
SQUIDCEXTERN HttpHdrCc *httpHdrCcDup(const HttpHdrCc * cc);
SQUIDCEXTERN void httpHdrCcPackInto(const HttpHdrCc * cc, Packer * p);
-SQUIDCEXTERN void httpHdrCcSetMaxAge(HttpHdrCc * cc, int max_age);
-SQUIDCEXTERN void httpHdrCcSetSMaxAge(HttpHdrCc * cc, int s_maxage);
SQUIDCEXTERN void httpHdrCcUpdateStats(const HttpHdrCc * cc, StatHist * hist);
void httpHdrCcStatDumper(StoreEntry * sentry, int idx, double val, double size, int count);