--------------------- PatchSet 117 Date: 2002/11/01 21:53:42 Author: rbcollins Branch: esi Tag: (none) Log: more method conversions Members: src/ESI.cc:1.1.2.25->1.1.2.26 Index: squid3/src/ESI.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ESI.cc,v retrieving revision 1.1.2.25 retrieving revision 1.1.2.26 diff -u -r1.1.2.25 -r1.1.2.26 --- squid3/src/ESI.cc 1 Nov 2002 21:41:22 -0000 1.1.2.25 +++ squid3/src/ESI.cc 1 Nov 2002 21:53:42 -0000 1.1.2.26 @@ -1,6 +1,6 @@ /* - * $Id: ESI.cc,v 1.1.2.25 2002/11/01 21:41:22 rbcollins Exp $ + * $Id: ESI.cc,v 1.1.2.26 2002/11/01 21:53:42 rbcollins Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -436,10 +436,10 @@ esiElement *tree; static void Free(void *); - - void fail (); + esiKick_t kick (); private: - void freeResources(); + void fail (); + void freeResources(); }; CBDATA_TYPE(esiContext); @@ -471,7 +471,6 @@ static CSCB esiBufferRecipient; static CSD esiBufferDetach; /* static void esiStartSub (void); */ -static esiKick_t esiKick (esiContext *context); static void esiAddStackElement (esiContext *context, esiElement *element); /* ESI TO CONSIDER: @@ -480,22 +479,22 @@ esiKick_t -esiKick (esiContext *context) +esiContext::kick () { - assert (context); - if (context->flags.kicked) { + assert (this); + if (flags.kicked) { debug (86,5)("esiKick: Re-entered whilst in progress\n"); // return ESI_KICK_PENDING; } else - ++context->flags.kicked; - if (context->flags.detached) + ++flags.kicked; + if (flags.detached) /* we've been detached from - we can't do anything more */ return ESI_KICK_FAILED; /* Something has occured. Process any remaining nodes */ - if (!context->flags.finished) + if (!flags.finished) /* Process some of our data */ - switch (esiProcess (context)) { + switch (esiProcess (this)) { case ESI_PROCESS_COMPLETE: debug (86,5)("esiKick: esiProcess OK\n");break; case ESI_PROCESS_PENDING_WONTFAIL: @@ -503,34 +502,34 @@ case ESI_PROCESS_PENDING_MAYFAIL: debug (86,5)("esiKick: esiProcess PENDING UNKNOWN\n");break; case ESI_PROCESS_FAILED: - debug (86,0)("esiKick: esiProcess %p FAILED\n", context); + debug (86,0)("esiKick: esiProcess %p FAILED\n", this); /* this can not happen - processing can't fail until we have data, * and when we come here we have sent data to the client */ - if (context->pos == 0) - context->fail (); - --context->flags.kicked; + if (pos == 0) + fail (); + --flags.kicked; return ESI_KICK_FAILED; } /* Render if we can to get maximal sent data */ - assert (context->tree || context->flags.error); + assert (tree || flags.error); - if (!context->outbound) - context->outbound = context->outboundtail = cbdataAlloc (esiSegment); - if (!context->flags.error) - context->tree->render(context->outboundtail); + if (!outbound) + outbound = outboundtail = cbdataAlloc (esiSegment); + if (!flags.error) + tree->render(outboundtail); /* TODO: fixup thisNode outboundtail dross a little */ - while (context->outboundtail->next) - context->outboundtail = context->outboundtail->next; + while (outboundtail->next) + outboundtail = outboundtail->next; /* Is there data to send? */ - if (esiSend (context->thisNode, context, context->http)) { + if (esiSend (thisNode, this, http)) { /* some data was sent. we're finished until the next read */ - --context->flags.kicked; + --flags.kicked; return ESI_KICK_SENT; } - --context->flags.kicked; + --flags.kicked; /* nothing to send */ return ESI_KICK_PENDING; } @@ -563,13 +562,11 @@ debug (86,5)("esiStreamRead: Client now wants data\n"); /* Ok, not passing through */ - switch (esiKick (context)) { + switch (context->kick ()) { case ESI_KICK_FAILED: - /* thisNode can not happen - processing can't fail until we have data, + /* this can not happen - processing can't fail until we have data, * and when we come here we have sent data to the client */ - cbdataReferenceDone (context); - return; case ESI_KICK_SENT: cbdataReferenceDone (context); return; @@ -650,7 +647,7 @@ esiAlwaysPassthrough(http_status sline) { switch (sline) { - case HTTP_CONTINUE: /* Should never reach us... but squid needs to alter to accomodate thisNode */ + case HTTP_CONTINUE: /* Should never reach us... but squid needs to alter to accomodate this */ case HTTP_SWITCHING_PROTOCOLS: /* Ditto */ case HTTP_PROCESSING: /* Unknown - some extension */ case HTTP_NO_CONTENT: /* no body, no esi */ @@ -868,7 +865,7 @@ context->flags.finishedtemplate = 1; } - switch (esiKick (context)) { + switch (context->kick()) { case ESI_KICK_FAILED: /* thisNode can not happen - processing can't fail until we have data, * and when we come here we have sent data to the client @@ -2180,7 +2177,7 @@ /* Kick ESI Processor */ debug (86,5)("esiInclude %p SubRequest %p completed, kicking processor , status %s\n", this, stream, flags.finished ? "OK" : "FAILED"); assert (context); - esiKick (context); + context->kick(); } }