From: wessels <> Date: Sun, 7 May 2006 04:23:44 +0000 (+0000) Subject: Converted most other httpHeader*() functions to HttpHeader class methods. X-Git-Tag: SQUID_3_0_PRE4~188 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4dd8a5fdd423be2e27c26b9ca906ec110b15ced2;p=thirdparty%2Fsquid.git Converted most other httpHeader*() functions to HttpHeader class methods. --- diff --git a/src/ESI.cc b/src/ESI.cc index 50b20c0cf0..e994428db8 100644 --- a/src/ESI.cc +++ b/src/ESI.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -902,10 +902,10 @@ ESIContextNew (HttpReply *rep, clientStreamNode *thisNode, ClientHttpRequest *ht /* 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; @@ -2430,7 +2430,7 @@ esiEnableProcessing (HttpReply *rep) { 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); diff --git a/src/ESIVarState.cc b/src/ESIVarState.cc index 624c7a5f8a..0077196449 100644 --- a/src/ESIVarState.cc +++ b/src/ESIVarState.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -302,7 +302,7 @@ ESIVarState::ESIVarState (HttpHeader const *aHeader, char const *uri) /* 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. @@ -373,8 +373,8 @@ ESIVariableUserAgent::ESIVariableUserAgent(ESIVarState &state) * 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; @@ -430,11 +430,11 @@ ESIVariableCookie::eval (ESIVarState &state, char const *subref, char const *fou 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()); @@ -454,8 +454,8 @@ ESIVariableHost::eval (ESIVarState &state, char const *subref, char const *found 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; @@ -468,12 +468,12 @@ ESIVariableLanguage::eval (ESIVarState &state, char const *subref, char const *f 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"; @@ -517,8 +517,8 @@ ESIVariableReferer::eval (ESIVarState &state, char const *subref, char const *fo 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; @@ -531,9 +531,9 @@ ESIVariableUserAgent::eval (ESIVarState &state, char const *subref, char const * 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]; @@ -885,10 +885,10 @@ ESIVarState::buildVary (HttpReply *rep) 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); } }