--------------------- PatchSet 4708 Date: 2002/08/18 12:35:24 Author: rbcollins Branch: esi Tag: (none) Log: update debug levels for finished code Members: src/ESI.c:1.1.2.12->1.1.2.13 Index: squid/src/ESI.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/ESI.c,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -u -r1.1.2.12 -r1.1.2.13 --- squid/src/ESI.c 18 Aug 2002 11:29:12 -0000 1.1.2.12 +++ squid/src/ESI.c 18 Aug 2002 12:35:24 -0000 1.1.2.13 @@ -1,6 +1,6 @@ /* - * $Id: ESI.c,v 1.1.2.12 2002/08/18 11:29:12 rbcollins Exp $ + * $Id: ESI.c,v 1.1.2.13 2002/08/18 12:35:24 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -71,7 +71,7 @@ * * * Interpreter methods: - * Render: May only ever be calle dafter Process returns PROCESS_COMPLETE. + * Render: May only ever be called after Process returns PROCESS_COMPLETE. * Renders the resulting content into a esiSegment chain. * Process: returns the status of the node. * COMPLETE - processing is complete, rendering may staret @@ -86,7 +86,6 @@ * TODO: inline variables * TODO: 3.3 choose when otherwise * TODO: 3.4 try attempt except - * TODO: 3.6 remove * TODO: 3.7 vars * * @@ -305,11 +304,11 @@ /* Process some of our data */ switch (esiProcess (context)) { case ESI_PROCESS_COMPLETE: - debug (86,1)("esiKick: esiProcess OK\n");break; + debug (86,5)("esiKick: esiProcess OK\n");break; case ESI_PROCESS_PENDING_WONTFAIL: - debug (86,1)("esiKick: esiProcess PENDING OK\n");break; + debug (86,5)("esiKick: esiProcess PENDING OK\n");break; case ESI_PROCESS_PENDING_MAYFAIL: - debug (86,1)("esiKick: esiProcess PENDING UNKNOWN\n");break; + debug (86,5)("esiKick: esiProcess PENDING UNKNOWN\n");break; case ESI_PROCESS_FAILED: debug (86,0)("esiKick: esiProcess FAILED\n"); /* this can not happen - processing can't fail until we have data, @@ -393,7 +392,7 @@ * processing. stop here, a callback will resume the stream * flow */ - debug (86,1) ("esiStreamRead: Waiting for async resume of esi processing\n"); + debug (86,5) ("esiStreamRead: Waiting for async resume of esi processing\n"); cbdataReferenceDone (context); return; } @@ -401,7 +400,7 @@ if (context->flags.oktosend && context->flags.finished) { assert (!context->outbound); /* We've finished processing, and there is no more data buffered */ - debug (0,0)("Telling recipient EOF on READ\n"); + debug (86,5)("Telling recipient EOF on READ\n"); clientStreamCallback (this, http, NULL, NULL, 0); cbdataReferenceDone (context); return; @@ -442,7 +441,7 @@ if (context->flags.oktosend && context->flags.finished && !(context->outbound && context->outbound_offset < context->outbound->len)) { cbdataReferenceDone (context); - debug (86,1) ("Telling recipient EOF on STATUS\n"); + debug (86,5) ("Telling recipient EOF on STATUS\n"); return STREAM_UNPLANNED_COMPLETE; /* we don't know lengths in advance */ } /* ?? RC: we can't be aborted / fail ? */ @@ -586,11 +585,11 @@ if (body_data) { /* Increase our buffer area with incoming data */ assert (body_size <= HTTP_REQBUF_SZ); - debug (86,1 )("ESIProcessStream found %u bytes of body data at offset %ld\n", body_size, this->readoff); + debug (86,5)("esiProcessStream found %u bytes of body data at offset %ld\n", body_size, this->readoff); /* secure the data for later use */ if (!context->incoming) { /* create a new buffer segment */ - debug (86,1) ("esiProcessStream: Setting up incoming buffer\n"); + debug (86,5) ("esiProcessStream: Setting up incoming buffer\n"); CBDATA_INIT_TYPE(esiSegment); context->buffered = cbdataAlloc (esiSegment); context->incoming = context->buffered; @@ -599,7 +598,7 @@ /* We have to copy the data out because we didn't supply this buffer */ size_t space = HTTP_REQBUF_SZ - context->incoming->len; size_t len = space < body_size ? space : body_size; - debug (86,1)("Copying data from %p to %p because our buffer was not used\n", body_data, + debug (86,5)("Copying data from %p to %p because our buffer was not used\n", body_data, &context->incoming->buf[context->incoming->len]); xmemcpy (&context->incoming->buf[context->incoming->len], body_data, len); context->incoming->len += len; @@ -632,7 +631,7 @@ if (rep == NULL && body_data == NULL && body_size == 0 && !context->flags.finishedtemplate) { /* TODO: get stream status to test the entry for aborts */ /* else flush the esi processor */ - debug (86,1)("Finished reading upstream data\n"); + debug (86,5)("Finished reading upstream data\n"); /* This is correct */ context->flags.finishedtemplate = 1; } @@ -831,7 +830,7 @@ } - debug (86,1)("esi stack depth %d\n",context->parserState.stackdepth); + debug (86,5)("esi stack depth %d\n",context->parserState.stackdepth); } /* End of start handler */ @@ -908,7 +907,7 @@ assert (context->flags.finished == 0); if (!context->parserState.stackdepth) { - debug (86,1)("empty parser stack, inserting the top level node\n"); + debug (86,5)("empty parser stack, inserting the top level node\n"); assert (context->tree); context->parserState.stack[context->parserState.stackdepth++] = context->tree; } @@ -960,13 +959,13 @@ esiProcessResult_t status = PROCESS(context->tree); switch (status) { case ESI_PROCESS_COMPLETE: - debug (86,1)("esiProcess: tree Processed OK\n"); + debug (86,5)("esiProcess: tree Processed OK\n"); break; case ESI_PROCESS_PENDING_WONTFAIL: - debug (86,1)("esiProcess: tree Processed PENDING OK\n"); + debug (86,5)("esiProcess: tree Processed PENDING OK\n"); break; case ESI_PROCESS_PENDING_MAYFAIL: - debug (86,1)("eseProcess: tree Processed PENDING UNKNOWN\n"); + debug (86,5)("eseProcess: tree Processed PENDING UNKNOWN\n"); break; case ESI_PROCESS_FAILED: debug (86,0)("esiProcess: tree Processed FAILED\n"); @@ -980,13 +979,13 @@ /* We've read the entire template, and no nodes will * return failure */ - debug (86,1)("esiProcess, request will succeed\n"); + debug (86,5)("esiProcess, request will succeed\n"); context->flags.oktosend = 1; } if (status == ESI_PROCESS_COMPLETE && context->flags.finishedtemplate) { /* we've finished all processing. Render and send. */ - debug (86,1)("esiProcess, processing complete\n"); + debug (86,5)("esiProcess, processing complete\n"); context->flags.finished = 1; } @@ -1150,7 +1149,7 @@ /* EOF / Read error / aborted entry */ if (rep == NULL && body_data == NULL && body_size == 0) { /* TODO: get stream status to test the entry for aborts */ - debug (86,1)("Finished reading upstream data in subrequest\n"); + debug (86,5)("Finished reading upstream data in subrequest\n"); esiIncludeSubRequestDone (esiStream->include, esiStream, 1); esiStream->finished = 1; cbdataReferenceDone (esiStream); @@ -1201,7 +1200,7 @@ http, http->out.offset, sizeof (esiStream->buffer->buf), esiStream->buffer->buf); - debug (86,0)("Requested more data for ESI subrequest\n"); + debug (86,5)("esiBufferRecipient: Requested more data for ESI subrequest\n"); } break; default:fatal ("Hit unreachable code in esiBufferRecipient\n"); @@ -1217,7 +1216,7 @@ assert (esiStream); cbdataReferenceDone (esiStream->include); esiSegmentFreeList (&esiStream->localbuffer.next); - debug (86,1)("Freeing stream context\n"); + debug (86,5)("Freeing stream context\n"); } esiStreamContext * @@ -1331,7 +1330,7 @@ { esiSequence *this = data; int i; - debug (86,1)("esiSequenceFree %p\n", this); + debug (86,5)("esiSequenceFree %p\n", this); for (i = 0; i < this->elementcount; ++i) { cbdataFree(this->elements[i]); } @@ -1450,7 +1449,7 @@ httpHeaderPutStr (&tempheaders, HDR_SURROGATE_CAPABILITY, "Surrogate/1.0"); /* TODO: evaluate variables */ if (clientBeginRequest(METHOD_GET, url, esiBufferRecipient, stream, &tempheaders, stream->localbuffer.buf, HTTP_REQBUF_SZ)) { - debug (86,0 ) ("starting new ESI subrequest failed\n"); + debug (86,0) ("starting new ESI subrequest failed\n"); } httpHeaderClean (&tempheaders); @@ -1598,7 +1597,7 @@ } if (this->flags.finished || this->flags.failed) { /* Kick ESI Processor */ - debug (86,1)("esiInclude %p SubRequest %p completed, kicking processor , status %s\n", this, stream, this->flags.finished ? "OK" : "FAILED"); + debug (86,5)("esiInclude %p SubRequest %p completed, kicking processor , status %s\n", this, stream, this->flags.finished ? "OK" : "FAILED"); assert (this->context); esiKick (this->context); }