--------------------- PatchSet 470 Date: 2002/12/24 04:21:23 Author: rbcollins Branch: esi Tag: (none) Log: generate AST caches correctly Members: src/ESI.cc:1.1.2.75->1.1.2.76 src/ESIContext.cc:1.1.2.3->1.1.2.4 src/ESISegment.cc:1.1.2.6->1.1.2.7 src/ESISegment.h:1.1.2.6->1.1.2.7 Index: squid3/src/ESI.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ESI.cc,v retrieving revision 1.1.2.75 retrieving revision 1.1.2.76 diff -u -r1.1.2.75 -r1.1.2.76 --- squid3/src/ESI.cc 24 Dec 2002 01:48:49 -0000 1.1.2.75 +++ squid3/src/ESI.cc 24 Dec 2002 04:21:23 -0000 1.1.2.76 @@ -1,6 +1,6 @@ /* - * $Id: ESI.cc,v 1.1.2.75 2002/12/24 01:48:49 rbcollins Exp $ + * $Id: ESI.cc,v 1.1.2.76 2002/12/24 04:21:23 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -2729,6 +2729,7 @@ ESIElement::Pointer esiTry::makeCacheable() const { + debug (86,5)("esiTry::makeCacheable: making cachable Try from %p\n",this); return new esiTry (*this); } Index: squid3/src/ESIContext.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ESIContext.cc,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- squid3/src/ESIContext.cc 24 Dec 2002 01:43:41 -0000 1.1.2.3 +++ squid3/src/ESIContext.cc 24 Dec 2002 04:21:23 -0000 1.1.2.4 @@ -1,6 +1,6 @@ /* - * $Id: ESIContext.cc,v 1.1.2.3 2002/12/24 01:43:41 rbcollins Exp $ + * $Id: ESIContext.cc,v 1.1.2.4 2002/12/24 04:21:23 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -41,9 +41,13 @@ void ESIContext::updateCachedAST() { - ESIElement::Pointer treeToCache = tree->makeCacheable(); assert (http); assert (http->entry); + if (http->entry->cachedESITree.getRaw()) { + debug (86,5)("ESIContext::updateCachedAST: not updating AST cache for entry %p from ESI Context %p as there is already a cached AST.\n", http->entry, this); + return; + } + ESIElement::Pointer treeToCache = tree->makeCacheable(); debug (86,5)("ESIContext::updateCachedAST: Updating AST cache for entry %p with current value %p to new value %p\n", http->entry, http->entry->cachedESITree.getRaw(), treeToCache.getRaw()); if (http->entry->cachedESITree.getRaw()) http->entry->cachedESITree->finish(); Index: squid3/src/ESISegment.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ESISegment.cc,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- squid3/src/ESISegment.cc 23 Dec 2002 23:17:49 -0000 1.1.2.6 +++ squid3/src/ESISegment.cc 24 Dec 2002 04:21:23 -0000 1.1.2.7 @@ -1,6 +1,6 @@ /* - * $Id: ESISegment.cc,v 1.1.2.6 2002/12/23 23:17:49 rbcollins Exp $ + * $Id: ESISegment.cc,v 1.1.2.7 2002/12/24 04:21:23 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -164,3 +164,8 @@ ESISegment::ESISegment() : len(0), next(NULL) { } + +ESISegment::ESISegment(ESISegment const &old) : len (0), next(NULL) +{ + append (old.buf, old.len); +} Index: squid3/src/ESISegment.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ESISegment.h,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- squid3/src/ESISegment.h 23 Dec 2002 23:17:49 -0000 1.1.2.6 +++ squid3/src/ESISegment.h 24 Dec 2002 04:21:23 -0000 1.1.2.7 @@ -1,5 +1,5 @@ /* - * $Id: ESISegment.h,v 1.1.2.6 2002/12/23 23:17:49 rbcollins Exp $ + * $Id: ESISegment.h,v 1.1.2.7 2002/12/24 04:21:23 rbcollins Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -47,6 +47,7 @@ void deleteSelf() const; ESISegment(); + ESISegment(ESISegment const &); ESISegment::Pointer clone() const; char buf[HTTP_REQBUF_SZ];