/*
- * $Id: HttpHdrCc.cc,v 1.20 2000/03/06 16:23:27 wessels Exp $
+ * $Id: HttpHdrCc.cc,v 1.21 2000/11/09 03:09:47 wessels Exp $
*
* DEBUG: section 65 HTTP Cache Control Header
* AUTHOR: Alex Rousskov
{"only-if-cached", CC_ONLY_IF_CACHED},
{"max-age", CC_MAX_AGE},
{"s-maxage", CC_S_MAXAGE},
+ {"max-stale", CC_MAX_STALE},
{"Other,", CC_OTHER} /* ',' will protect from matches */
};
HttpHeaderFieldInfo *CcFieldsInfo = NULL;
httpHdrCcCreate(void)
{
HttpHdrCc *cc = memAllocate(MEM_HTTP_HDR_CC);
- cc->max_age = cc->s_maxage = -1;
+ cc->max_age = cc->s_maxage = cc->max_stale = -1;
return cc;
}
EBIT_CLR(cc->mask, type);
}
break;
+ case CC_MAX_STALE:
+ if (!p || !httpHeaderParseInt(p, &cc->max_stale)) {
+ debug(65, 2) ("cc: max-stale directive is valid without value\n");
+ cc->max_stale = -1;
+ }
+ break;
default:
/* note that we ignore most of '=' specs */
break;
dup->mask = cc->mask;
dup->max_age = cc->max_age;
dup->s_maxage = cc->s_maxage;
+ dup->max_stale = cc->max_stale;
return dup;
}
if (flag == CC_S_MAXAGE)
packerPrintf(p, "=%d", (int) cc->s_maxage);
+ if (flag == CC_MAX_STALE)
+ packerPrintf(p, "=%d", (int) cc->max_stale);
+
pcount++;
}
}
cc->max_age = new_cc->max_age;
if (cc->s_maxage < 0)
cc->s_maxage = new_cc->s_maxage;
+ if (cc->max_stale < 0)
+ cc->max_stale = new_cc->max_stale;
cc->mask |= new_cc->mask;
}