]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Converted most other httpHeader*() functions to HttpHeader class methods.
authorwessels <>
Sun, 7 May 2006 04:23:44 +0000 (04:23 +0000)
committerwessels <>
Sun, 7 May 2006 04:23:44 +0000 (04:23 +0000)
src/ESI.cc
src/ESIVarState.cc

index 50b20c0cf03d1537021f10133d9d591e2ecc182c..e994428db8b9b9abdec71a067547c82b3c537a6d 100644 (file)
@@ -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);
 
index 624c7a5f8aeb0b69682aada45e12de3164a74752..007719644922c5d203b7a67a65a12b9466acaa9b 100644 (file)
@@ -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);
     }
 }