--------------------- PatchSet 103 Date: 2002/11/01 02:48:38 Author: rbcollins Branch: esi Tag: (none) Log: esiTryAdd->esiTry::addElement Members: src/ESI.cc:1.1.2.12->1.1.2.13 Index: squid3/src/ESI.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ESI.cc,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -u -r1.1.2.12 -r1.1.2.13 --- squid3/src/ESI.cc 1 Nov 2002 02:43:05 -0000 1.1.2.12 +++ squid3/src/ESI.cc 1 Nov 2002 02:48:38 -0000 1.1.2.13 @@ -1,6 +1,6 @@ /* - * $Id: ESI.cc,v 1.1.2.12 2002/11/01 02:43:05 rbcollins Exp $ + * $Id: ESI.cc,v 1.1.2.13 2002/11/01 02:48:38 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -198,7 +198,6 @@ struct esiInclude; static void esiIncludeSubRequestDone (esiInclude *, esiStreamContext *, int); -static esiAddElement esiTryAdd; static esiProcessSelf esiTryProcess; static esiAddElement esiChooseAdd; @@ -224,7 +223,7 @@ static esiElementType _esiSequence = {addSelf,esiSequenceProcess}; static esiElementType _esiInclude = {addSelf, esiIncludeProcess}; static esiElementType _esiRemove = {addSelf, esiProcessComplete}; -static esiElementType _esiTry = {esiTryAdd, esiTryProcess}; +static esiElementType _esiTry = {addSelf, esiTryProcess}; /* esiAttempt, esiExcept, esiVar, esiWhen and esiOtherwise are 'Sequences' */ static esiElementType _esiAttempt = {addSelf,esiSequenceProcess}; static esiElementType _esiExcept = {addSelf,esiSequenceProcess}; @@ -346,6 +345,7 @@ esiTry(); void render(esiSegment *); + bool addElement (esiElement *); esiElement *attempt; esiElement *except; struct { @@ -2319,33 +2319,32 @@ /* Accept attempt and except only */ bool -esiTryAdd (esiElement *data, esiElement *element) +esiTry::addElement(esiElement *element) { - esiTry *thisNode = (esiTry *)data; - debug (86,5)("esiTryAdd: Try %p adding element %p\n",thisNode, element); + debug (86,5)("esiTryAdd: Try %p adding element %p\n",this, element); if (element->Vptr == &_esiLiteral) { /* Swallow whitespace */ - debug (86,5)("esiTryAdd: Try %p skipping whitespace %p\n",thisNode, element); + debug (86,5)("esiTryAdd: Try %p skipping whitespace %p\n",this, element); cbdataFree (element); return true; } if (element->Vptr == &_esiAttempt) { - if (thisNode->attempt) { - debug (86,1)("esiTryAdd: Failed for %p - try allready has an attempt node (section 3.4)\n",data); + if (attempt) { + debug (86,1)("esiTryAdd: Failed for %p - try allready has an attempt node (section 3.4)\n",this); return false; } - thisNode->attempt = element; + attempt = element; return true; } if (element->Vptr == &_esiExcept) { - if (thisNode->except) { - debug (86,1)("esiTryAdd: Failed for %p - try already has an except node (section 3.4)\n",data); + if (except) { + debug (86,1)("esiTryAdd: Failed for %p - try already has an except node (section 3.4)\n",this); return false; } - thisNode->except = element; + except = element; return true; } - debug (86,1)("esiTryAdd: Failed to add element %p to try %p, incorrect element type (see section 3.4)\n", element, thisNode); + debug (86,1)("esiTryAdd: Failed to add element %p to try %p, incorrect element type (see section 3.4)\n", element, this); return false; }