From: wessels <> Date: Sat, 6 May 2006 05:57:40 +0000 (+0000) Subject: converted httpHeaderClean() to HttpHeader::clean() X-Git-Tag: SQUID_3_0_PRE4~192 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=519e09488c672fbac7f046e15db7f199d24e9a15;p=thirdparty%2Fsquid.git converted httpHeaderClean() to HttpHeader::clean() --- diff --git a/src/ESIInclude.cc b/src/ESIInclude.cc index f15aa6b86a..56f2a0b664 100644 --- a/src/ESIInclude.cc +++ b/src/ESIInclude.cc @@ -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) diff --git a/src/ESIVarState.cc b/src/ESIVarState.cc index 511989f226..624c7a5f8a 100644 --- a/src/ESIVarState.cc +++ b/src/ESIVarState.cc @@ -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 * diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index c38cd30cfd..9e60f707f0 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -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; } diff --git a/src/HttpHeader.h b/src/HttpHeader.h index f4700262e2..ece4b572d5 100644 --- a/src/HttpHeader.h +++ b/src/HttpHeader.h @@ -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 entries; /* parsed fields in raw format */ diff --git a/src/HttpHeaderTools.cc b/src/HttpHeaderTools.cc index 6942fac767..8173d2862e 100644 --- a/src/HttpHeaderTools.cc +++ b/src/HttpHeaderTools.cc @@ -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(); } diff --git a/src/HttpReply.cc b/src/HttpReply.cc index 3c9c0c5fe6..2db142bae4 100644 --- a/src/HttpReply.cc +++ b/src/HttpReply.cc @@ -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); } diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index a89b94a5b0..ea86dadd57 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -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); diff --git a/src/client_side.cc b/src/client_side.cc index d6bad92349..555bdc3b41 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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 (we packed a header, not a reply) */ mb->Printf("\r\n"); diff --git a/src/htcp.cc b/src/htcp.cc index c05231782e..fe8053fd0b 100644 --- a/src/htcp.cc +++ b/src/htcp.cc @@ -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); diff --git a/src/http.cc b/src/http.cc index 7322f3a164..c9a46dbdfa 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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 */ diff --git a/src/protos.h b/src/protos.h index 635de7ff77..a0f79567fe 100644 --- a/src/protos.h +++ b/src/protos.h @@ -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 */ diff --git a/src/tunnel.cc b/src/tunnel.cc index 15cb78d3a1..34503a320e 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -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);