--------------------- PatchSet 442 Date: 2002/12/20 20:18:44 Author: rbcollins Branch: esi Tag: (none) Log: more separation Members: src/ESI.cc:1.1.2.57->1.1.2.58 Index: squid3/src/ESI.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ESI.cc,v retrieving revision 1.1.2.57 retrieving revision 1.1.2.58 diff -u -r1.1.2.57 -r1.1.2.58 --- squid3/src/ESI.cc 20 Dec 2002 20:08:07 -0000 1.1.2.57 +++ squid3/src/ESI.cc 20 Dec 2002 20:18:44 -0000 1.1.2.58 @@ -1,6 +1,6 @@ /* - * $Id: ESI.cc,v 1.1.2.57 2002/12/20 20:08:07 rbcollins Exp $ + * $Id: ESI.cc,v 1.1.2.58 2002/12/20 20:18:44 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -1399,8 +1399,8 @@ if (buffered->len) { int lastBlock = buffered->next == NULL && flags.finishedtemplate ? 1 : 0; if (! XML_Parse(parserState.p, buffered->buf, buffered->len, lastBlock)) { - char tempstr[1024]; setError(); + char tempstr[1024]; snprintf (tempstr, 1023, "esiProcess: Parse error at line %d:\n%s\n", XML_GetCurrentLineNumber(parserState.p), XML_ErrorString(XML_GetErrorCode(parserState.p))); @@ -1473,6 +1473,14 @@ return ESI_PROCESS_FAILED; } + if (!flags.finishedtemplate && !incoming) { + incoming = buffered = new ESISegment; + } + + if (!flags.finishedtemplate) { + return ESI_PROCESS_PENDING_MAYFAIL; + } + /* ok, we've done all we can with the data. What can we process now? */ { @@ -1512,11 +1520,6 @@ flags.finished = 1; } - - - if (!flags.finishedtemplate && !incoming) { - incoming = buffered = new ESISegment; - } PROF_stop(esiProcessing); return status; /* because we have no callbacks */ }