]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
converted httpHeaderClean() to HttpHeader::clean()
authorwessels <>
Sat, 6 May 2006 05:57:40 +0000 (05:57 +0000)
committerwessels <>
Sat, 6 May 2006 05:57:40 +0000 (05:57 +0000)
12 files changed:
src/ESIInclude.cc
src/ESIVarState.cc
src/HttpHeader.cc
src/HttpHeader.h
src/HttpHeaderTools.cc
src/HttpReply.cc
src/HttpRequest.cc
src/client_side.cc
src/htcp.cc
src/http.cc
src/protos.h
src/tunnel.cc

index f15aa6b86a8a664236241737f7e615d1abc16f41..56f2a0b6642796d5627f62ac2c238c36fd81b8ca 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ESIInclude.cc,v 1.8 2005/11/05 00:08:32 wessels Exp $
+ * $Id: ESIInclude.cc,v 1.9 2006/05/05 23:57:40 wessels Exp $
  *
  * DEBUG: section 86    ESI processing
  * AUTHOR: Robert Collins
@@ -335,7 +335,7 @@ ESIInclude::Start (ESIStreamContext::Pointer stream, char const *url, ESIVarStat
         debug (86,0) ("starting new ESI subrequest failed\n");
     }
 
-    httpHeaderClean (&tempheaders);
+    tempheaders.clean();
 }
 
 ESIInclude::ESIInclude (esiTreeParentPtr aParent, int attrcount, char const **attr, ESIContext *aContext) : parent (aParent), started (false), sent (false)
index 511989f226c54426b9a35210ccc60a410114b521..624c7a5f8aeb0b69682aada45e12de3164a74752 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ESIVarState.cc,v 1.5 2005/07/03 15:25:08 serassio Exp $
+ * $Id: ESIVarState.cc,v 1.6 2006/05/05 23:57:40 wessels Exp $
  *
  * DEBUG: section 86    ESI processing
  * AUTHOR: Robert Collins
@@ -183,7 +183,7 @@ ESIVarState::freeResources()
 {
     input = NULL;
     ESISegmentFreeList (output);
-    httpHeaderClean (&hdr);
+    hdr.clean();
 }
 
 void *
index c38cd30cfd4800e1d804328edb4727139aa45bde..9e60f707f0ccd56d3c49d7365f0de6c5186d0740 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHeader.cc,v 1.115 2006/05/05 20:13:04 wessels Exp $
+ * $Id: HttpHeader.cc,v 1.116 2006/05/05 23:57:40 wessels Exp $
  *
  * DEBUG: section 55    HTTP Header
  * AUTHOR: Alex Rousskov
@@ -363,21 +363,20 @@ HttpHeader::HttpHeader(http_hdr_owner_type const &anOwner) : owner (anOwner), le
 
 HttpHeader::~HttpHeader()
 {
-    httpHeaderClean (this);
+    clean();
 }
 
 void
-httpHeaderClean(HttpHeader * hdr)
+HttpHeader::clean()
 {
     HttpHeaderPos pos = HttpHeaderInitPos;
     HttpHeaderEntry *e;
 
-    assert(hdr);
-    assert(hdr->owner > hoNone && hdr->owner <= hoReply);
-    debug(55, 7) ("cleaning hdr: %p owner: %d\n", hdr, hdr->owner);
+    assert(owner > hoNone && owner <= hoReply);
+    debug(55, 7) ("cleaning hdr: %p owner: %d\n", this, owner);
 
     /*
-     * An unfortunate bug.  The hdr->entries array is initialized
+     * An unfortunate bug.  The entries array is initialized
      * such that count is set to zero.  httpHeaderClean() seems to
      * be called both when 'hdr' is created, and destroyed.  Thus,
      * we accumulate a large number of zero counts for 'hdr' before
@@ -387,28 +386,28 @@ httpHeaderClean(HttpHeader * hdr)
      * arrays.
      */
 
-    if (0 != hdr->entries.count)
-        statHistCount(&HttpHeaderStats[hdr->owner].hdrUCountDistr, hdr->entries.count);
+    if (0 != entries.count)
+        statHistCount(&HttpHeaderStats[owner].hdrUCountDistr, entries.count);
 
-    HttpHeaderStats[hdr->owner].destroyedCount++;
+    HttpHeaderStats[owner].destroyedCount++;
 
-    HttpHeaderStats[hdr->owner].busyDestroyedCount += hdr->entries.count > 0;
+    HttpHeaderStats[owner].busyDestroyedCount += entries.count > 0;
 
-    while ((e = httpHeaderGetEntry(hdr, &pos))) {
+    while ((e = httpHeaderGetEntry(this, &pos))) {
         /* tmp hack to try to avoid coredumps */
 
         if (e->id < 0 || e->id >= HDR_ENUM_END) {
             debug(55, 0) ("httpHeaderClean BUG: entry[%d] is invalid (%d). Ignored.\n",
                           (int) pos, e->id);
         } else {
-            statHistCount(&HttpHeaderStats[hdr->owner].fieldTypeDistr, e->id);
+            statHistCount(&HttpHeaderStats[owner].fieldTypeDistr, e->id);
             /* yes, this destroy() leaves us in an inconsistent state */
             httpHeaderEntryDestroy(e);
         }
     }
 
-    hdr->entries.clean();
-    httpHeaderMaskInit(&hdr->mask, 0);
+    entries.clean();
+    httpHeaderMaskInit(&mask, 0);
 }
 
 /* append entries (also see httpHeaderUpdate) */
@@ -462,7 +461,7 @@ httpHeaderReset(HttpHeader * hdr)
     http_hdr_owner_type ho;
     assert(hdr);
     ho = hdr->owner;
-    httpHeaderClean(hdr);
+    hdr->clean();
     *hdr = HttpHeader(ho);
     return 0;
 }
index f4700262e21013c54789f46aca7bbcc92719862b..ece4b572d5a30174c3ad103e1c39c8a3d089af0c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHeader.h,v 1.9 2006/04/22 05:29:18 robertc Exp $
+ * $Id: HttpHeader.h,v 1.10 2006/05/05 23:57:40 wessels Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -158,6 +158,7 @@ public:
     ~HttpHeader();
     /* Interface functions */
     void update (HttpHeader const *fresh, HttpHeaderMask const *denied_mask);
+    void clean();
     void removeConnectionHeaderEntries();
     /* protected, do not use these, use interface functions instead */
     Vector<HttpHeaderEntry *> entries;         /* parsed fields in raw format */
index 6942fac767c0d6eb21222ad01826207555f034b5..8173d2862e59297953baedbb0fb69fb7509aad32 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpHeaderTools.cc,v 1.53 2005/12/26 11:35:22 serassio Exp $
+ * $Id: HttpHeaderTools.cc,v 1.54 2006/05/05 23:57:40 wessels Exp $
  *
  * DEBUG: section 66    HTTP Header Tools
  * AUTHOR: Alex Rousskov
@@ -454,7 +454,7 @@ httpHeaderTestParser(const char *hstr)
                       bug_count, pos, hstr + pos, hstr, mb.buf);
     }
 
-    httpHeaderClean(&hdr);
+    hdr.clean();
     packerClean(&p);
     mb.clean();
 }
index 3c9c0c5fe686919c6641721bfb26600750dd7982..2db142bae4cbaa4c6e46240fc97fde4c62f6f5e1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpReply.cc,v 1.84 2006/04/22 05:29:18 robertc Exp $
+ * $Id: HttpReply.cc,v 1.85 2006/05/05 23:57:40 wessels Exp $
  *
  * DEBUG: section 58    HTTP Reply (Response)
  * AUTHOR: Alex Rousskov
@@ -99,7 +99,7 @@ HttpReply::clean()
 {
     httpBodyClean(&body);
     hdrCacheClean();
-    httpHeaderClean(&header);
+    header.clean();
     httpStatusLineClean(&sline);
 }
 
index a89b94a5b0c8c9d6a4788667decd99a1c510026c..ea86dadd57a61856308bdc4c8f0a036c5000c1e6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: HttpRequest.cc,v 1.63 2006/05/03 14:04:44 robertc Exp $
+ * $Id: HttpRequest.cc,v 1.64 2006/05/05 23:57:40 wessels Exp $
  *
  * DEBUG: section 73    HTTP Request
  * AUTHOR: Duane Wessels
@@ -115,7 +115,7 @@ HttpRequest::clean()
 
     urlpath.clean();
 
-    httpHeaderClean(&header);
+    header.clean();
 
     if (cache_control) {
         httpHdrCcDestroy(cache_control);
index d6bad923499531e8900c1a0222945270af2810a7..555bdc3b41db2257d39dc1dee5a37479396a4c72 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.720 2006/05/03 14:04:44 robertc Exp $
+ * $Id: client_side.cc,v 1.721 2006/05/05 23:57:40 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -865,7 +865,7 @@ clientPackRangeHdr(const HttpReply * rep, const HttpHdrRangeSpec * spec, String
 
     packerClean(&p);
 
-    httpHeaderClean(&hdr);
+    hdr.clean();
 
     /* append <crlf> (we packed a header, not a reply) */
     mb->Printf("\r\n");
index c05231782e75614c743e7700f8f87cc09d3d045a..fe8053fd0b653346923bff5f9dfbe604c147319b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: htcp.cc,v 1.63 2006/05/03 14:04:44 robertc Exp $
+ * $Id: htcp.cc,v 1.64 2006/05/05 23:57:40 wessels Exp $
  *
  * DEBUG: section 31    Hypertext Caching Protocol
  * AUTHOR: Duane Wesssels
@@ -778,7 +778,7 @@ htcpTstReply(htcpDataHeader * dhdr, StoreEntry * e, htcpSpecifier * spec, struct
         stuff.D.cache_hdrs = xstrdup(mb.buf);
         debug(31, 3) ("htcpTstReply: cache_hdrs = {%s}\n", stuff.D.cache_hdrs);
         mb.clean();
-        httpHeaderClean(&hdr);
+        hdr.clean();
         packerClean(&p);
     }
 
@@ -916,7 +916,7 @@ htcpHandleTstResponse(htcpDataHeader * hdr, char *buf, int sz, struct sockaddr_i
     key = queried_keys[htcpReply.msg_id % N_QUERIED_KEYS];
     debug(31, 3) ("htcpHandleTstResponse: key (%p) %s\n", key, storeKeyText(key));
     neighborsHtcpReply(key, &htcpReply, from);
-    httpHeaderClean(&htcpReply.hdr);
+    htcpReply.hdr.clean();
 
     if (d)
         htcpFreeDetail(d);
@@ -1228,7 +1228,7 @@ htcpQuery(StoreEntry * e, HttpRequest * req, peer * p)
 
     httpHeaderPackInto(&hdr, &pa);
 
-    httpHeaderClean(&hdr);
+    hdr.clean();
 
     packerClean(&pa);
 
index 7322f3a16470d4cccdc8d7d79b771401f1918b1b..c9a46dbdfad66b5445d10c42499b1bf1fdaaa962 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.493 2006/04/27 19:27:37 wessels Exp $
+ * $Id: http.cc,v 1.494 2006/05/05 23:57:40 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -1733,7 +1733,7 @@ HttpStateData::buildRequestPrefix(HttpRequest * request,
         httpBuildRequestHeader(request, orig_request, entry, &hdr, flags);
         packerToMemInit(&p, mb);
         httpHeaderPackInto(&hdr, &p);
-        httpHeaderClean(&hdr);
+        hdr.clean();
         packerClean(&p);
     }
     /* append header terminator */
index 635de7ff7776858c8e9ba5ca5a7abbd562f7091f..a0f79567feed160aae1be853b201e2f70fde9b6a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: protos.h,v 1.526 2006/05/05 19:57:32 wessels Exp $
+ * $Id: protos.h,v 1.527 2006/05/05 23:57:40 wessels Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -326,8 +326,6 @@ SQUIDCEXTERN void httpHeaderPutStrf();
 /* Http Header */
 SQUIDCEXTERN void httpHeaderInitModule(void);
 SQUIDCEXTERN void httpHeaderCleanModule(void);
-/* init/clean */
-SQUIDCEXTERN void httpHeaderClean(HttpHeader * hdr);
 /* append/update */
 SQUIDCEXTERN void httpHeaderAppend(HttpHeader * dest, const HttpHeader * src);
 /* parse/pack */
index 15cb78d3a17040bcf1d36dd0880fbb3d6d577d5b..34503a320e645a7359fb4c73d8b5ad564dc525a1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tunnel.cc,v 1.160 2006/04/02 14:32:35 serassio Exp $
+ * $Id: tunnel.cc,v 1.161 2006/05/05 23:57:40 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -694,7 +694,7 @@ sslProxyConnected(int fd, void *data)
                                           flags);                      /* flags */
     packerToMemInit(&p, &mb);
     httpHeaderPackInto(&hdr_out, &p);
-    httpHeaderClean(&hdr_out);
+    hdr_out.clean();
     packerClean(&p);
     mb.append("\r\n", 2);