--------------------- PatchSet 428 Date: 2002/12/20 07:12:52 Author: rbcollins Branch: esi Tag: (none) Log: rename esiSegment to ESISegment Members: src/ESI.cc:1.1.2.45->1.1.2.46 src/ESIElement.h:1.1.2.5->1.1.2.6 src/ESISegment.cc:1.1.2.2->1.1.2.3 src/ESISegment.h:1.1.2.2->1.1.2.3 Index: squid3/src/ESI.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ESI.cc,v retrieving revision 1.1.2.45 retrieving revision 1.1.2.46 diff -u -r1.1.2.45 -r1.1.2.46 --- squid3/src/ESI.cc 20 Dec 2002 07:06:44 -0000 1.1.2.45 +++ squid3/src/ESI.cc 20 Dec 2002 07:12:52 -0000 1.1.2.46 @@ -1,6 +1,6 @@ /* - * $Id: ESI.cc,v 1.1.2.45 2002/12/20 07:06:44 rbcollins Exp $ + * $Id: ESI.cc,v 1.1.2.46 2002/12/20 07:12:52 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -60,7 +60,7 @@ * * Interpreter methods: * Render: May only ever be called after Process returns PROCESS_COMPLETE. - * Renders the resulting content into a esiSegment chain. + * Renders the resulting content into a ESISegment chain. * Process: returns the status of the node. * COMPLETE - processing is complete, rendering may staret * PENDING_WONTFAIL - process is incomplete, but the element *will* @@ -97,7 +97,7 @@ /* Recursive uses are not supported by design */ struct _query_elem{char *var, *val;}; struct esiVarState { - esiSegment *extractList(); + ESISegment *extractList(); char *extractChar(); void feedData (const char *buf, size_t len); void buildVary (HttpReply *rep); @@ -110,8 +110,8 @@ private: char *getProductVersion (char const *s); - esiSegment *input; - esiSegment *output; + ESISegment *input; + ESISegment *output; HttpHeader hdr; struct _query_elem *query; size_t query_sz; @@ -193,7 +193,7 @@ ~esiComment(); esiComment(); - void render(esiSegment *); + void render(ESISegment *); private: static MemPool *pool; }; @@ -205,14 +205,14 @@ void operator delete (void *address); void deleteSelf() const; - esiLiteral(esiSegment *); + esiLiteral(ESISegment *); esiLiteral(esiContext *, const XML_Char *s, int len); ~esiLiteral(); - void render(esiSegment *); + void render(ESISegment *); esiProcessResult_t process (int dovars); /* optimise copies away later */ - esiSegment *buffer; + ESISegment *buffer; struct { int donevars:1; } flags; @@ -232,10 +232,10 @@ esiSequence(esiTreeParentPtr); ~esiSequence(); - void render(esiSegment *); + void render(ESISegment *); bool addElement (ESIElement::Pointer); esiProcessResult_t process (int dovars); - void provideData (esiSegment *, ESIElement*); + void provideData (ESISegment *, ESIElement*); bool mayFail () const; void wontFail(); void fail(ESIElement *); @@ -265,7 +265,7 @@ esiInclude(esiTreeParentPtr, int attributes, const char **attr, esiContext *); ~esiInclude(); - void render(esiSegment *); + void render(ESISegment *); esiProcessResult_t process (int dovars); void subRequestDone (esiStreamContext *, bool); struct { @@ -275,8 +275,8 @@ } flags; esiStreamContext *src; esiStreamContext *alt; - esiSegment *srccontent; - esiSegment *altcontent; + ESISegment *srccontent; + ESISegment *altcontent; esiContext *context; char *srcurl, *alturl; void fail(esiStreamContext *); @@ -286,7 +286,7 @@ void start(); bool started; bool sent; - void copyLeadSegment (esiSegment *&, esiSegment &); + void copyLeadSegment (ESISegment *&, ESISegment &); }; MemPool *esiInclude::Pool = NULL; @@ -298,7 +298,7 @@ void deleteSelf() const; esiRemove(); - void render(esiSegment *); + void render(ESISegment *); bool addElement (ESIElement::Pointer); }; CBDATA_TYPE (esiRemove); @@ -330,11 +330,11 @@ esiTry(esiTreeParentPtr aParent); ~esiTry(); - void render(esiSegment *); + void render(ESISegment *); bool addElement (ESIElement::Pointer); void fail(ESIElement *); esiProcessResult_t process (int dovars); - void provideData (esiSegment *data, ESIElement * source); + void provideData (ESISegment *data, ESIElement * source); ESIElement::Pointer attempt; ESIElement::Pointer except; @@ -348,7 +348,7 @@ static MemPool *Pool; void notifyParent(); esiTreeParentPtr parent; - esiSegment* exceptbuffer; + ESISegment* exceptbuffer; }; MemPool *esiTry::Pool = NULL; @@ -371,12 +371,12 @@ esiChoose(esiTreeParentPtr); ~esiChoose(); - void render(esiSegment *); + void render(ESISegment *); bool addElement (ESIElement::Pointer); void fail(ESIElement *); esiProcessResult_t process (int dovars); - void provideData (esiSegment *data, ESIElement *source); + void provideData (ESISegment *data, ESIElement *source); ESIElement::Pointer * elements; /* unprocessed nodes */ int allocedcount; @@ -423,7 +423,7 @@ esiContext():reading_(true) {} /* when esi processing completes */ - void provideData(esiSegment *, ESIElement *source); + void provideData(ESISegment *, ESIElement *source); void fail (ESIElement *source); void startRead(); void finishRead(); @@ -455,12 +455,12 @@ http_status errorstatus; /* if we error, what code to return */ char *errormessage; /* error to pass to error page */ HttpReply *rep; /* buffered until we pass data downstream */ - esiSegment *buffered; /* unprocessed data - for whatever reason */ - esiSegment *incoming; - esiSegment *outbound; /* processed data we are waiting to send, or for + ESISegment *buffered; /* unprocessed data - for whatever reason */ + ESISegment *incoming; + ESISegment *outbound; /* processed data we are waiting to send, or for * potential errors to be resolved */ - esiSegment *outboundtail; /* our write segment */ + ESISegment *outboundtail; /* our write segment */ size_t outbound_offset; /* the offset to the next character to send - * non zero if we haven't sent the entire segment * for some reason @@ -486,7 +486,7 @@ void trimBlanks(); size_t send (); bool reading_; - void appendOutboundData(esiSegment *theData); + void appendOutboundData(ESISegment *theData); }; CBDATA_CLASS_INIT(esiContext); @@ -508,8 +508,8 @@ struct _esiStreamContext { int finished; esiIncludePtr include; - esiSegment localbuffer; - esiSegment *buffer; + ESISegment localbuffer; + ESISegment *buffer; }; CBDATA_TYPE (esiStreamContext); @@ -567,7 +567,7 @@ } void -esiContext::appendOutboundData(esiSegment *theData) +esiContext::appendOutboundData(ESISegment *theData) { if (!outbound) { outbound = theData; @@ -580,7 +580,7 @@ } void -esiContext::provideData (esiSegment *theData, ESIElement * source) +esiContext::provideData (ESISegment *theData, ESIElement * source) { debug (86,5)("esiContext::provideData: %p %p %p\n",this, theData, source); if (!tree.getRaw()) @@ -644,7 +644,7 @@ assert (tree.getRaw() || flags.error); if (!outbound) - outbound = outboundtail = new esiSegment; + outbound = outboundtail = new ESISegment; if (!flags.error) { tree->render(outboundtail); fixupOutboundTail(); @@ -733,7 +733,7 @@ /* secure a buffer */ if (!context->incoming) { /* create a new buffer segment */ - context->buffered = new esiSegment; + context->buffered = new ESISegment; context->incoming = context->buffered; } assert (context->incoming && context->incoming->len != HTTP_REQBUF_SZ); @@ -798,7 +798,7 @@ /* trim leading empty buffers ? */ while (outbound && outbound->next && !outbound->len) { - esiSegment *temp = outbound->next; + ESISegment *temp = outbound->next; cbdataFree (outbound); outbound = temp; } @@ -858,7 +858,7 @@ if (len) { xmemcpy (next->readBuffer.data, &outbound->buf[outbound_offset], len); if (len + outbound_offset == outbound->len) { - esiSegment *temp = outbound->next; + ESISegment *temp = outbound->next; /* remove the used buffer */ outbound_offset = 0; cbdataFree (outbound); @@ -869,7 +869,7 @@ outboundtail = NULL; /* trim leading empty buffers ? */ while (outbound && outbound->next && !outbound->len) { - esiSegment *temp = outbound->next; + ESISegment *temp = outbound->next; cbdataFree (outbound); outbound = temp; } @@ -975,7 +975,7 @@ if (!context->incoming) { /* create a new buffer segment */ debug (86,5) ("esiProcessStream: Setting up incoming buffer\n"); - context->buffered = new esiSegment; + context->buffered = new ESISegment; context->incoming = context->buffered; } if (recievedData.data != &context->incoming->buf[context->incoming->len]) { @@ -988,7 +988,7 @@ context->incoming->len += len; if (context->incoming->len == HTTP_REQBUF_SZ) { /* append another buffer */ - context->incoming->next = new esiSegment; + context->incoming->next = new ESISegment; context->incoming = context->incoming->next; } if (len != recievedData.length) { @@ -1004,7 +1004,7 @@ assert (context->incoming->len <= HTTP_REQBUF_SZ); if (context->incoming->len > HTTP_REQBUF_SZ * 3 / 4) { /* allocate a new buffer - to stop us asking for ridiculously small amounts */ - context->incoming->next = new esiSegment; + context->incoming->next = new ESISegment; context->incoming = context->incoming->next; } context->readpos += recievedData.length; @@ -1403,7 +1403,7 @@ PROF_start(esiParsing); while (context->buffered) { - esiSegment *temp; + ESISegment *temp; if (context->buffered->len) { if (! XML_Parse(context->parserState.p, context->buffered->buf, context->buffered->len, context->flags.finishedtemplate)) { char tempstr[1024]; @@ -1478,7 +1478,7 @@ if (!context->flags.finishedtemplate && !context->incoming) { - context->incoming = context->buffered = new esiSegment; + context->incoming = context->buffered = new ESISegment; } PROF_stop(esiProcessing); return status; /* because we have no callbacks */ @@ -1497,8 +1497,8 @@ XML_ParserFree (parserState.p); flags.parserinited = 0; } - esiSegmentFreeList (&buffered); - esiSegmentFreeList (&outbound); + ESISegmentFreeList (&buffered); + ESISegmentFreeList (&outbound); cbdataFree (varState); /* don't touch incoming, it's a pointer into buffered anyway */ } @@ -1534,7 +1534,7 @@ while (errorprogress < (size_t)rep->body.mb.size) { size_t amount; - appendOutboundData(new esiSegment); + appendOutboundData(new ESISegment); amount = rep->body.mb.size - errorprogress; if (amount > HTTP_REQBUF_SZ) amount = HTTP_REQBUF_SZ; @@ -1681,7 +1681,7 @@ } while (esiStream->buffer->next) esiStream->buffer = esiStream->buffer->next; if (esiStream->buffer->len) { - esiStream->buffer->next = new esiSegment; + esiStream->buffer->next = new ESISegment; esiStream->buffer = esiStream->buffer->next; } tempBuffer.offset = http->out.offset; @@ -1705,7 +1705,7 @@ esiStreamContext *esiStream = (esiStreamContext *)data; assert (esiStream); esiStream->include = NULL; - esiSegmentFreeList (&esiStream->localbuffer.next); + ESISegmentFreeList (&esiStream->localbuffer.next); debug (86,5)("Freeing stream context\n"); } @@ -1753,7 +1753,7 @@ } void -esiComment::render(esiSegment *output) +esiComment::render(ESISegment *output) { /* Comments do nothing dude */ debug (86, 5)("esiCommentRender: Rendering comment %p\n", output); @@ -1784,11 +1784,11 @@ esiLiteral::~esiLiteral() { debug (86, 5) ("esiLiteral::~esiLiteral: %p\n", this); - esiSegmentFreeList (&buffer); + ESISegmentFreeList (&buffer); cbdataReferenceDone (varState); } -esiLiteral::esiLiteral(esiSegment *aSegment) +esiLiteral::esiLiteral(ESISegment *aSegment) { buffer = aSegment; /* we've been handed a complete, processed string */ @@ -1802,8 +1802,8 @@ esiLiteral::esiLiteral(esiContext *context, const XML_Char *s, int numberOfCharacters) { assert (s); - buffer = new esiSegment; - esiSegment *local = buffer; + buffer = new ESISegment; + ESISegment *local = buffer; off_t start = 0; int remainingCharacters = numberOfCharacters; while (remainingCharacters > 0) { @@ -1815,7 +1815,7 @@ remainingCharacters -= len; s += len; if (local->len == sizeof (local->buf) && remainingCharacters){ - local->next = new esiSegment; + local->next = new ESISegment; local=local->next; } } @@ -1823,11 +1823,11 @@ } void -esiLiteral::render (esiSegment *output) +esiLiteral::render (ESISegment *output) { debug (86,9)("esiLiteral::render: Rendering %p\n",this); /* append the entire chain */ - esiSegment *myout = output; + ESISegment *myout = output; assert (myout->next == NULL); myout->next = buffer; buffer = NULL; @@ -1839,14 +1839,14 @@ if (flags.donevars) return ESI_PROCESS_COMPLETE; if (dovars) { - esiSegment *temp = buffer; + ESISegment *temp = buffer; /* Ensure variable state is clean */ while (temp) { varState->feedData(temp->buf,temp->len); temp = temp->next; } /* free the pre-processed content */ - esiSegmentFreeList (&buffer); + ESISegmentFreeList (&buffer); buffer = varState->extractList (); } flags.donevars = 1; @@ -1908,7 +1908,7 @@ } void -esiSequence::render(esiSegment *output) +esiSequence::render(ESISegment *output) { /* append all processed elements, and trim processed * and rendered elements @@ -1918,7 +1918,7 @@ debug (86,5)("esiSequenceRender: rendering %d elements\n", processedcount); for (i = 0; i < processedcount; ++i) { elements[i]->render(output); - /* FIXME: pass a esiSegment ** ? */ + /* FIXME: pass a ESISegment ** ? */ while (output->next) output = output->next; elements[i] = NULL; @@ -1932,7 +1932,7 @@ } void -esiSequence::provideData (esiSegment *data, ESIElement *source) +esiSequence::provideData (ESISegment *data, ESIElement *source) { debug (86,5) ("esiSequence::provideData %p %p %p\n", this, data, source); /* when data is provided, the element *must* be completed */ @@ -1969,7 +1969,7 @@ dynamic_cast(elements[elementcount - 1].getRaw())) { debug (86,5)("esiSequenceAdd: tying Literals %p and %p together\n", elements[elementcount - 1].getRaw(), element.getRaw()); - esiSegmentTransferList (&((esiLiteral *)element.getRaw())->buffer, + ESISegmentTransferList (&((esiLiteral *)element.getRaw())->buffer, &((esiLiteral *)elements[elementcount - 1].getRaw())->buffer); return true; } @@ -2036,12 +2036,12 @@ if (processedcount == elementcount || dynamic_cast(parent.getRaw())) { /* provide incremental data outside of the composite */ - esiSegment *temp = new esiSegment; + ESISegment *temp = new ESISegment; render (temp); if (temp->next || temp->len) parent->provideData(temp, this); else - esiSegmentFreeList (&temp); + ESISegmentFreeList (&temp); } debug (86,5)("esiSequence::process: %p completed\n", this); @@ -2058,8 +2058,8 @@ esiInclude::~esiInclude() { debug (86,5)("esiInclude::Free %p\n", this); - esiSegmentFreeList (&srccontent); - esiSegmentFreeList (&altcontent); + ESISegmentFreeList (&srccontent); + ESISegmentFreeList (&altcontent); cbdataReferenceDone (context); safe_free (srcurl); safe_free (alturl); @@ -2172,11 +2172,11 @@ } void -esiInclude::render(esiSegment *output) +esiInclude::render(ESISegment *output) { if (sent) return; - esiSegment *myout = NULL; + ESISegment *myout = NULL; debug (86, 5)("esiIncludeRender: Rendering include %p\n", this); assert (flags.finished || (flags.failed && flags.onerrorcontinue)); if (flags.failed && flags.onerrorcontinue) { @@ -2223,9 +2223,9 @@ } void -esiInclude::copyLeadSegment (esiSegment *&target, esiSegment &source) +esiInclude::copyLeadSegment (ESISegment *&target, ESISegment &source) { - target = new esiSegment; + target = new ESISegment; xmemcpy (target->buf, source.buf, source.len); target->len = source.len; target->next = source.next; @@ -2296,7 +2296,7 @@ /* render nothing but inform of completion */ if (!sent) { sent = true; - parent->provideData (new esiSegment, this); + parent->provideData (new ESISegment, this); } else assert (0); } else @@ -2345,7 +2345,7 @@ } void -esiRemove::render(esiSegment *output) +esiRemove::render(ESISegment *output) { /* Removes do nothing dude */ debug (86, 5)("esiRemoveRender: Rendering remove %p\n", this); @@ -2394,7 +2394,7 @@ } void -esiTry::render (esiSegment *output) +esiTry::render (ESISegment *output) { /* Try renders from it's children */ assert (this); @@ -2405,7 +2405,7 @@ attempt->render(output); } else if (flags.exceptok) { if (exceptbuffer) - esiSegmentTransferList(&exceptbuffer, &output); + ESISegmentTransferList(&exceptbuffer, &output); else except->render(output); } else @@ -2535,7 +2535,7 @@ } void -esiTry::provideData (esiSegment *data, ESIElement* source) +esiTry::provideData (ESISegment *data, ESIElement* source) { if (source == attempt) { flags.attemptok = 1; @@ -2543,8 +2543,8 @@ } else if (source == except) { flags.exceptok = 1; assert (exceptbuffer == NULL); - esiSegment *t = data; - esiSegmentTransferList (&t, &exceptbuffer); + ESISegment *t = data; + ESISegmentTransferList (&t, &exceptbuffer); notifyParent(); } } @@ -2631,7 +2631,7 @@ void esiVarState::freeResources() { - esiSegmentFreeList (&output); + ESISegmentFreeList (&output); httpHeaderClean (&hdr); if (query) { unsigned int i; @@ -2800,14 +2800,14 @@ { /* TODO: if needed - tune to skip segment iteration */ debug (86,6)("esiVarState::feedData: accepting %d bytes\n", len); - esiSegmentListAppend (&input, buf, len); + ESISegmentListAppend (&input, buf, len); } -esiSegment * +ESISegment * esiVarState::extractList() { doIt(); - esiSegment *rv = output; + ESISegment *rv = output; output = NULL; debug (86,6)("esiVarStateExtractList: Extracted list\n"); return rv; @@ -2819,8 +2819,8 @@ if (!input) fatal ("Attempt to extract variable state with no data fed in \n"); doIt(); - char *rv = esiSegmentListToChar(output); - esiSegmentFreeList (&output); + char *rv = ESISegmentListToChar(output); + ESISegmentFreeList (&output); debug (86,6)("esiVarStateExtractList: Extracted char\n"); return rv; } @@ -2865,7 +2865,7 @@ if (!subref && httpHeaderHas(&hdr,HDR_HOST)) { s = httpHeaderGetStr (&hdr, HDR_HOST); } else s = found_default; - esiSegmentListAppend (&output, s, strlen (s)); + ESISegmentListAppend (&output, s, strlen (s)); break; case ESI_VAR_COOKIE: flags.cookie = 1; @@ -2875,15 +2875,15 @@ else { String S = httpHeaderGetListMember (&hdr, HDR_COOKIE, subref, ';'); if (strLen(S)) - esiSegmentListAppend (&output, strBuf(S), strLen (S)); + ESISegmentListAppend (&output, strBuf(S), strLen (S)); else if (found_default) - esiSegmentListAppend (&output, found_default, strlen (found_default)); + ESISegmentListAppend (&output, found_default, strlen (found_default)); stringClean (&S); } } else s = found_default; if (s) - esiSegmentListAppend (&output, s, strlen (s)); + ESISegmentListAppend (&output, s, strlen (s)); break; case ESI_VAR_REFERER: flags.referer = 1; @@ -2891,7 +2891,7 @@ s = httpHeaderGetStr (&hdr, HDR_REFERER); else s = found_default; - esiSegmentListAppend (&output, s, strlen (s)); + ESISegmentListAppend (&output, s, strlen (s)); break; case ESI_QUERY_STRING: if (!subref) @@ -2906,7 +2906,7 @@ if (!s) s = found_default; } - esiSegmentListAppend (&output, s, strlen (s)); + ESISegmentListAppend (&output, s, strlen (s)); break; case ESI_VAR_USERAGENT: flags.useragent = 1; @@ -2924,14 +2924,14 @@ s = ""; } } else s = found_default; - esiSegmentListAppend (&output, s, strlen (s)); + ESISegmentListAppend (&output, s, strlen (s)); break; case ESI_VAR_LANGUAGE: flags.language = 1; if (httpHeaderHas(&hdr, HDR_ACCEPT_LANGUAGE)) { if (!subref) { String S = httpHeaderGetList (&hdr, HDR_ACCEPT_LANGUAGE); - esiSegmentListAppend (&output, strBuf(S), strLen (S)); + ESISegmentListAppend (&output, strBuf(S), strLen (S)); stringClean (&S); } else { if (httpHeaderHasListMember (&hdr, HDR_ACCEPT_LANGUAGE, subref, ',')) { @@ -2939,17 +2939,17 @@ } else { s = "false"; } - esiSegmentListAppend (&output, s, strlen (s)); + ESISegmentListAppend (&output, s, strlen (s)); } } else { s = found_default; - esiSegmentListAppend (&output, s, strlen (s)); + ESISegmentListAppend (&output, s, strlen (s)); } break; case ESI_VAR_OTHER: /* No-op. We swallow it */ if (found_default) { - esiSegmentListAppend (&output, found_default, strlen (found_default)); + ESISegmentListAppend (&output, found_default, strlen (found_default)); } break; } @@ -3016,7 +3016,7 @@ { assert (output == NULL); int state = 0; - char *string = esiSegmentListToChar(input); + char *string = ESISegmentListToChar(input); size_t len = strlen (string); size_t pos = 0; size_t var_pos = 0; @@ -3024,7 +3024,7 @@ char * found_subref = NULL; char *found_default = NULL; esiVar_t vartype = ESI_VAR_OTHER; - esiSegmentFreeList (&input); + ESISegmentFreeList (&input); while (pos < len) { switch (state) { case 0: /* skipping pre-variables */ @@ -3033,7 +3033,7 @@ } else { if (pos - done_pos) /* extract known good text */ - esiSegmentListAppend (&output, string + done_pos, pos - done_pos); + ESISegmentListAppend (&output, string + done_pos, pos - done_pos); done_pos = pos; state = 1; ++pos; @@ -3140,7 +3140,7 @@ } /* pos-done_pos chars are ready to copy */ if (pos-done_pos) - esiSegmentListAppend (&output, string+done_pos, pos - done_pos); + ESISegmentListAppend (&output, string+done_pos, pos - done_pos); safe_free (found_default); safe_free (found_subref); } @@ -3207,7 +3207,7 @@ } void -esiChoose::render(esiSegment *output) +esiChoose::render(ESISegment *output) { /* append all processed elements, and trim processed and rendered elements */ assert (output->next == NULL); @@ -3297,7 +3297,7 @@ } void -esiChoose::provideData (esiSegment *data, ESIElement*source) +esiChoose::provideData (ESISegment *data, ESIElement*source) { checkValidSource (source); parent->provideData (data, this); Index: squid3/src/ESIElement.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ESIElement.h,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- squid3/src/ESIElement.h 20 Dec 2002 05:36:29 -0000 1.1.2.5 +++ squid3/src/ESIElement.h 20 Dec 2002 07:12:53 -0000 1.1.2.6 @@ -1,5 +1,5 @@ /* - * $Id: ESIElement.h,v 1.1.2.5 2002/12/20 05:36:29 rbcollins Exp $ + * $Id: ESIElement.h,v 1.1.2.6 2002/12/20 07:12:53 rbcollins Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -35,7 +35,7 @@ #include "RefCount.h" -class esiSegment; +class ESISegment; typedef enum { ESI_PROCESS_COMPLETE, ESI_PROCESS_PENDING_WONTFAIL, @@ -45,7 +45,7 @@ class ESIElement; struct esiTreeParent : public RefCountable { - virtual void provideData (esiSegment *data, ESIElement * source) + virtual void provideData (ESISegment *data, ESIElement * source) { /* make abstract when all functionality complete */ assert (0); @@ -63,7 +63,7 @@ debug (86,5)("ESIElement::addElement: Failed for %p\n",this); return false; } - virtual void render (esiSegment *) = 0; + virtual void render (ESISegment *) = 0; /* process this element */ virtual esiProcessResult_t process (int dovars) { debug (86,5) ("esiProcessComplete: Processed %p\n",this); Index: squid3/src/ESISegment.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ESISegment.cc,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid3/src/ESISegment.cc 3 Nov 2002 06:15:16 -0000 1.1.2.2 +++ squid3/src/ESISegment.cc 20 Dec 2002 07:12:53 -0000 1.1.2.3 @@ -1,6 +1,6 @@ /* - * $Id: ESISegment.cc,v 1.1.2.2 2002/11/03 06:15:16 rbcollins Exp $ + * $Id: ESISegment.cc,v 1.1.2.3 2002/12/20 07:12:53 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -36,25 +36,25 @@ #include "squid.h" #include "ESISegment.h" -CBDATA_TYPE(esiSegment); +CBDATA_TYPE(ESISegment); -/* esiSegment */ +/* ESISegment */ void -esiSegmentFreeList (esiSegment **head) { +ESISegmentFreeList (ESISegment **head) { while (*head) { - esiSegment *temp = *head; + ESISegment *temp = *head; *head = temp->next; cbdataFree (temp); } } void -esiSegmentTransferList (esiSegment **from, esiSegment **to) +ESISegmentTransferList (ESISegment **from, ESISegment **to) { if (!*to) { *to = *from; } else { - esiSegment *temp = *to; + ESISegment *temp = *to; while (temp->next) temp = temp->next; temp->next = *from; } @@ -62,11 +62,11 @@ } char * -esiSegmentListToChar (esiSegment *head) +ESISegmentListToChar (ESISegment *head) { char *rv; size_t len = 0, pos = 0; - esiSegment *temp; + ESISegment *temp; assert (head); temp = head; while (temp) { @@ -86,12 +86,12 @@ } void -esiSegmentListAppend (esiSegment **head, char const *s, size_t len) +ESISegmentListAppend (ESISegment **head, char const *s, size_t len) { - esiSegment *output; + ESISegment *output; size_t pos=0; if (!*head) - *head = cbdataAlloc (esiSegment); + *head = cbdataAlloc (ESISegment); output = *head; while (output->next) output=output->next; @@ -100,7 +100,7 @@ size_t amount; if (output->len == sizeof (output->buf)) { assert (output->next == NULL); - output->next = new esiSegment; + output->next = new ESISegment; output = output->next; } amount = len - pos; @@ -113,32 +113,32 @@ } void * -esiSegment::operator new(size_t byteCount) +ESISegment::operator new(size_t byteCount) { - assert (byteCount == sizeof (esiSegment)); + assert (byteCount == sizeof (ESISegment)); void *rv; - CBDATA_INIT_TYPE(esiSegment); - rv = (void *)cbdataAlloc (esiSegment); + CBDATA_INIT_TYPE(ESISegment); + rv = (void *)cbdataAlloc (ESISegment); return rv; } void -esiSegment::operator delete (void *address) +ESISegment::operator delete (void *address) { - cbdataFree ((esiSegment *)address); + cbdataFree ((ESISegment *)address); } void -esiSegment::deleteSelf() +ESISegment::deleteSelf() { delete this; } /* XXX: if needed, make this iterative */ -esiSegment * -esiSegment::clone () const +ESISegment * +ESISegment::clone () const { - esiSegment *result = new esiSegment (*this); + ESISegment *result = new ESISegment (*this); result->next = next ? next->clone() : NULL; return result; } Index: squid3/src/ESISegment.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ESISegment.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid3/src/ESISegment.h 3 Nov 2002 06:15:16 -0000 1.1.2.2 +++ squid3/src/ESISegment.h 20 Dec 2002 07:12:53 -0000 1.1.2.3 @@ -1,5 +1,5 @@ /* - * $Id: ESISegment.h,v 1.1.2.2 2002/11/03 06:15:16 rbcollins Exp $ + * $Id: ESISegment.h,v 1.1.2.3 2002/12/20 07:12:53 rbcollins Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -37,21 +37,22 @@ * or perhaps use membuffers here? */ -struct esiSegment { +class ESISegment { +public: void *operator new (size_t byteCount); void operator delete (void *address); void deleteSelf(); - esiSegment *clone() const; + ESISegment *clone() const; char buf[HTTP_REQBUF_SZ]; size_t len; /* how much data has been pushed into this */ - esiSegment *next; + ESISegment *next; }; -extern void esiSegmentFreeList (esiSegment **head); -extern void esiSegmentTransferList (esiSegment **from, esiSegment **to); -extern char *esiSegmentListToChar (esiSegment *head); -extern void esiSegmentListAppend (esiSegment **head, char const *, size_t); +extern void ESISegmentFreeList (ESISegment **head); +extern void ESISegmentTransferList (ESISegment **from, ESISegment **to); +extern char *ESISegmentListToChar (ESISegment *head); +extern void ESISegmentListAppend (ESISegment **head, char const *, size_t); #endif /* SQUID_ESISEGMENT_H */