/*
- * $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
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)
/*
- * $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
{
input = NULL;
ESISegmentFreeList (output);
- httpHeaderClean (&hdr);
+ hdr.clean();
}
void *
/*
- * $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
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
* 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) */
http_hdr_owner_type ho;
assert(hdr);
ho = hdr->owner;
- httpHeaderClean(hdr);
+ hdr->clean();
*hdr = HttpHeader(ho);
return 0;
}
/*
- * $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/
~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 */
/*
- * $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
bug_count, pos, hstr + pos, hstr, mb.buf);
}
- httpHeaderClean(&hdr);
+ hdr.clean();
packerClean(&p);
mb.clean();
}
/*
- * $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
{
httpBodyClean(&body);
hdrCacheClean();
- httpHeaderClean(&header);
+ header.clean();
httpStatusLineClean(&sline);
}
/*
- * $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
urlpath.clean();
- httpHeaderClean(&header);
+ header.clean();
if (cache_control) {
httpHdrCcDestroy(cache_control);
/*
- * $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
packerClean(&p);
- httpHeaderClean(&hdr);
+ hdr.clean();
/* append <crlf> (we packed a header, not a reply) */
mb->Printf("\r\n");
/*
- * $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
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);
}
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);
httpHeaderPackInto(&hdr, &pa);
- httpHeaderClean(&hdr);
+ hdr.clean();
packerClean(&pa);
/*
- * $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
httpBuildRequestHeader(request, orig_request, entry, &hdr, flags);
packerToMemInit(&p, mb);
httpHeaderPackInto(&hdr, &p);
- httpHeaderClean(&hdr);
+ hdr.clean();
packerClean(&p);
}
/* append header terminator */
/*
- * $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/
/* 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 */
/*
- * $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
flags); /* flags */
packerToMemInit(&p, &mb);
httpHeaderPackInto(&hdr_out, &p);
- httpHeaderClean(&hdr_out);
+ hdr_out.clean();
packerClean(&p);
mb.append("\r\n", 2);