/*
- * $Id: ESI.cc,v 1.20 2006/04/22 09:02:44 robertc Exp $
+ * $Id: ESI.cc,v 1.21 2006/05/06 22:23:44 wessels Exp $
*
* DEBUG: section 86 ESI processing
* AUTHOR: Robert Collins
/* remove specific headers for ESI to prevent
* downstream cache confusion */
HttpHeader *hdr = &rep->header;
- httpHeaderDelById(hdr, HDR_ACCEPT_RANGES);
- httpHeaderDelById(hdr, HDR_ETAG);
- httpHeaderDelById(hdr, HDR_CONTENT_LENGTH);
- httpHeaderDelById(hdr, HDR_CONTENT_MD5);
+ hdr->delById(HDR_ACCEPT_RANGES);
+ hdr->delById(HDR_ETAG);
+ hdr->delById(HDR_CONTENT_LENGTH);
+ hdr->delById(HDR_CONTENT_MD5);
rv->tree = new esiSequence (rv, true);
rv->thisNode = thisNode;
rv->http = http;
{
int rv = 0;
- if (httpHeaderHas(&rep->header, HDR_SURROGATE_CONTROL)) {
+ if (rep->header.has(HDR_SURROGATE_CONTROL)) {
HttpHdrScTarget *sctusable = httpHdrScGetMergedTarget (rep->surrogate_control,
Config.Accel.surrogate_id);
/*
- * $Id: ESIVarState.cc,v 1.6 2006/05/05 23:57:40 wessels Exp $
+ * $Id: ESIVarState.cc,v 1.7 2006/05/06 22:23:44 wessels Exp $
*
* DEBUG: section 86 ESI processing
* AUTHOR: Robert Collins
/* TODO: only grab the needed headers */
/* Note that as we pass these through to included requests, we
* cannot trim them */
- httpHeaderAppend (&hdr, aHeader);
+ hdr.append(aHeader);
/* populate our variables trie with the available variables.
* Additional ones can be added during the parsing.
* In future, this may be better implemented as a regexp.
*/
- if (httpHeaderHas(&state.header(), HDR_USER_AGENT)) {
- char const *s = httpHeaderGetStr (&state.header(), HDR_USER_AGENT);
+ if (state.header().has(HDR_USER_AGENT)) {
+ char const *s = state.header().getStr(HDR_USER_AGENT);
UserOs = identifyOs(s);
char const *t, *t1;
const char *s = NULL;
state.cookieUsed();
- if (httpHeaderHas(&state.header(), HDR_COOKIE)) {
+ if (state.header().has(HDR_COOKIE)) {
if (!subref)
- s = httpHeaderGetStr (&state.header(), HDR_COOKIE);
+ s = state.header().getStr (HDR_COOKIE);
else {
- String S = httpHeaderGetListMember (&state.header(), HDR_COOKIE, subref, ';');
+ String S = state.header().getListMember (HDR_COOKIE, subref, ';');
if (S.size())
ESISegment::ListAppend (state.getOutput(), S.buf(), S.size());
const char *s = NULL;
state.hostUsed();
- if (!subref && httpHeaderHas(&state.header(),HDR_HOST)) {
- s = httpHeaderGetStr (&state.header(), HDR_HOST);
+ if (!subref && state.header().has(HDR_HOST)) {
+ s = state.header().getStr (HDR_HOST);
} else
s = found_default;
char const *s = NULL;
state.languageUsed();
- if (httpHeaderHas(&state.header(), HDR_ACCEPT_LANGUAGE)) {
+ if (state.header().has(HDR_ACCEPT_LANGUAGE)) {
if (!subref) {
- String S (httpHeaderGetList (&state.header(), HDR_ACCEPT_LANGUAGE));
+ String S (state.header().getList (HDR_ACCEPT_LANGUAGE));
ESISegment::ListAppend (state.getOutput(), S.buf(), S.size());
} else {
- if (httpHeaderHasListMember (&state.header(), HDR_ACCEPT_LANGUAGE, subref, ',')) {
+ if (state.header().hasListMember (HDR_ACCEPT_LANGUAGE, subref, ',')) {
s = "true";
} else {
s = "false";
const char *s = NULL;
state.refererUsed();
- if (!subref && httpHeaderHas(&state.header(), HDR_REFERER))
- s = httpHeaderGetStr (&state.header(), HDR_REFERER);
+ if (!subref && state.header().has(HDR_REFERER))
+ s = state.header().getStr (HDR_REFERER);
else
s = found_default;
char const *s = NULL;
state.useragentUsed();
- if (httpHeaderHas(&state.header(), HDR_USER_AGENT)) {
+ if (state.header().has(HDR_USER_AGENT)) {
if (!subref)
- s = httpHeaderGetStr (&state.header(), HDR_USER_AGENT);
+ s = state.header().getStr (HDR_USER_AGENT);
else {
if (!strcmp (subref, "os")) {
s = esiUserOs[UserOs];
if (!tempstr[0])
return;
- String strVary (httpHeaderGetList (&rep->header, HDR_VARY));
+ String strVary (rep->header.getList (HDR_VARY));
if (!strVary.size() || strVary.buf()[0] != '*') {
- httpHeaderPutStr (&rep->header, HDR_VARY, tempstr);
+ rep->header.putStr (HDR_VARY, tempstr);
}
}