--------------------- PatchSet 469 Date: 2002/12/24 01:48:49 Author: rbcollins Branch: esi Tag: (none) Log: start caching AST trees Members: src/ESI.cc:1.1.2.74->1.1.2.75 Index: squid3/src/ESI.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ESI.cc,v retrieving revision 1.1.2.74 retrieving revision 1.1.2.75 diff -u -r1.1.2.74 -r1.1.2.75 --- squid3/src/ESI.cc 23 Dec 2002 23:17:49 -0000 1.1.2.74 +++ squid3/src/ESI.cc 24 Dec 2002 01:48:49 -0000 1.1.2.75 @@ -1,6 +1,6 @@ /* - * $Id: ESI.cc,v 1.1.2.74 2002/12/23 23:17:49 rbcollins Exp $ + * $Id: ESI.cc,v 1.1.2.75 2002/12/24 01:48:49 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -1450,7 +1450,7 @@ } assert (flags.finishedtemplate); - //updateCachedAST(); + updateCachedAST(); /* ok, we've done all we can with the data. What can we process now? */ { @@ -2163,18 +2163,25 @@ allocedcount = 0; allocedsize = 0; - for (int counter = 0; counter < old.elementcount; ++counter) - assert (addElement(old.elements[counter]->makeCacheable())); + for (int counter = 0; counter < old.elementcount; ++counter) { + ESIElement::Pointer newElement = old.elements[counter]->makeCacheable(); + if (newElement.getRaw()) + assert (addElement(newElement)); + } } ESIElement::Pointer esiSequence::makeCacheable() const { + debug (86,5)("esiSequence::makeCacheable: Making cachable sequence from %p\n", this); assert (processedcount == 0); assert (!failed); - if (elementcount == 0) + if (elementcount == 0) { + debug (86,5)("esiSequence::makeCacheable: No elements in sequence %p, returning NULL\n", this); return NULL; + } ESIElement::Pointer result = new esiSequence (*this); + debug (86,5)("esiSequence::makeCacheable: %p created %p\n", this, result.getRaw()); return result; } @@ -2516,7 +2523,8 @@ ESIElement::Pointer esiRemove::makeCacheable() const { - return new esiRemove; + debug (86,5)("esiRemove::makeCacheable: Returning NULL\n"); + return NULL; } /* esiTry */ @@ -3543,8 +3551,11 @@ allocedcount = 0; allocedsize = 0; - for (int counter = 0; counter < old.elementcount; ++counter) - assert (addElement(old.elements[counter]->makeCacheable())); + for (int counter = 0; counter < old.elementcount; ++counter) { + ESIElement::Pointer newElement = old.elements[counter]->makeCacheable(); + if (newElement.getRaw()) + assert (addElement(newElement)); + } } ESIElement::Pointer