--------------------- PatchSet 6164 Date: 2007/11/21 21:59:38 Author: chtsanti Branch: async-calls Tag: (none) Log: BodyPipe now uses the new job calls interface.Many changes in BodyPipe's related code: - Instead of scheduling BodyPipe calls we are scheduling BodyProducer and BodyCosnumer calls - BodyProducer/BodyConsumer::noteXXXXXX(BodyPipe &bp) methods converted to Body*::noteXXXXXX(BodyPipe::Pointer) to allow them used with new async calls interface - BodyPipe::tell* methods and related AsyncCallWrappers removed, does not needed any more. - Implement the CallNoteBodyProducer and CallNoteBodyConsumer JobCall based classes. These classes used too schedule calls for BodyConsumer and BodyProducer respectivelly. They are like the normal JobCalls but aditionally checks if the BodyConsumer and BodyProducer is still part of the pipe. - Implement the NullBodyConsumer class as a BodyConsumer child which just reads the data from pipe and discard them. This class used to replace old AutoConsume mechanism. - Removing the ICAPXaction_{Enter,Exit} calls from ICAPModXact::note* methods, does not needed any more (Their logic implemented inside the new async calls code). Members: src/BodyPipe.cc:1.7->1.7.4.1 src/BodyPipe.h:1.5.4.1->1.5.4.2 src/Server.cc:1.20.4.3->1.20.4.4 src/Server.h:1.10.4.4->1.10.4.5 src/client_side.cc:1.139.4.1->1.139.4.2 src/client_side.h:1.22.4.3->1.22.4.4 src/client_side_request.cc:1.79.4.2->1.79.4.3 src/client_side_request.h:1.30.4.4->1.30.4.5 src/ICAP/ICAPModXact.cc:1.31.4.1->1.31.4.2 src/ICAP/ICAPModXact.h:1.9->1.9.4.1 Index: squid3/src/BodyPipe.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/BodyPipe.cc,v retrieving revision 1.7 retrieving revision 1.7.4.1 diff -u -r1.7 -r1.7.4.1 --- squid3/src/BodyPipe.cc 1 Oct 2007 22:50:55 -0000 1.7 +++ squid3/src/BodyPipe.cc 21 Nov 2007 21:59:38 -0000 1.7.4.1 @@ -4,6 +4,77 @@ CBDATA_CLASS_INIT(BodyPipe); +class NullBodyConsumer: public BodyConsumer { + bool done; +public: + NullBodyConsumer():AsyncJob("NullBodyConsumer"), done(false){} + virtual ~NullBodyConsumer() {} + + virtual void noteMoreBodyDataAvailable(BodyPipe::Pointer bp) { + size_t contentSize = bp->buf().contentSize(); + bp->consume(contentSize); + } + virtual void noteBodyProductionEnded(BodyPipe::Pointer bp) { + stopConsumingFrom(bp); + done = true; + } + virtual void noteBodyProducerAborted(BodyPipe::Pointer bp) { + stopConsumingFrom(bp); + done = true; + } + bool doneAll() const {return done && AsyncJob::doneAll();} + CBDATA_CLASS2(NullBodyConsumer); +}; + +CBDATA_CLASS_INIT(NullBodyConsumer); + + +class CallNoteBodyConsumer: + public JobCallT< UnaryMemFunT > +{ +public: + typedef JobCallT< UnaryMemFunT > Parent; + typedef void (BodyProducer::*noteConsumerHandler)(BodyPipe::Pointer ); + + CallNoteBodyConsumer(BodyProducer *aProducer, noteConsumerHandler aHandler, + BodyPipe::Pointer bp, const char *callName): + Parent(MemFun(aProducer, aHandler, bp), 93, 5, callName),thePipe(bp),theProducer(aProducer){} + + virtual bool fire() { + assert(theProducer); + if(!cbdataReferenceValid(theCbdata)) + return false; + return !theProducer->ignoreLateConsumerNote(thePipe) && Parent::fire(); + } +private: + BodyPipe::Pointer thePipe; + BodyProducer *theProducer; +}; + + +class CallNoteBodyProducer: + public JobCallT< UnaryMemFunT > +{ +public: + typedef JobCallT< UnaryMemFunT > Parent; + typedef void (BodyConsumer::*noteProducerHandler)(BodyPipe::Pointer ); + + CallNoteBodyProducer(BodyConsumer *aConsumer, noteProducerHandler aHandler, + BodyPipe::Pointer bp, const char *callName): + Parent(MemFun(aConsumer, aHandler, bp), 93, 5, callName),thePipe(bp),theConsumer(aConsumer){} + + virtual bool fire() { + assert(theConsumer); + if(!cbdataReferenceValid(theCbdata)) + return false; + return !theConsumer->ignoreLateProducerNote(thePipe) && Parent::fire(); + } +private: + BodyPipe::Pointer thePipe; + BodyConsumer *theConsumer; +}; + + // inform the pipe that we are done and clear the Pointer void BodyProducer::stopProducingFor(RefCount &pipe, bool atEof) { @@ -14,6 +85,12 @@ pipe = NULL; } +bool BodyProducer::ignoreLateConsumerNote(RefCount &bp) +{ + assert(bp!=NULL); + return !bp->checkProducer(this); +} + // inform the pipe that we are done and clear the Pointer void BodyConsumer::stopConsumingFrom(RefCount &pipe) { @@ -23,6 +100,12 @@ pipe = NULL; } +bool BodyConsumer::ignoreLateProducerNote(RefCount &bp) +{ + assert(bp!=NULL); + return !bp->checkConsumer(this); +} + /* BodyPipe */ BodyPipe::BodyPipe(Producer *aProducer): theBodySize(-1), @@ -153,8 +236,10 @@ debugs(91,7, HERE << "clearing consumer" << status()); theConsumer = NULL; theCCallsToSkip = theCCallsPending; // skip all pending consumer calls - if (consumedSize() && !exhausted()) - AsyncCall(91,5, this, BodyPipe::tellBodyConsumerAborted); + if (consumedSize() && !exhausted()){ + AsyncCallBase *call= new CallNoteBodyConsumer(theProducer, &BodyProducer::noteBodyConsumerAborted, this, "BodyProducer::noteBodyConsumerAborted"); + scheduleJob(91,5, call); + } } } @@ -184,8 +269,10 @@ BodyPipe::enableAutoConsumption() { mustAutoConsume = true; debugs(91,5, HERE << "enabled auto consumption" << status()); - if (!theConsumer && theBuf.hasContent()) + if (!theConsumer && theBuf.hasContent()){ + theConsumer = new NullBodyConsumer; scheduleBodyDataNotification(); + } } MemBuf & @@ -229,8 +316,10 @@ assert(!isCheckedOut); theGetSize += size; debugs(91,7, HERE << "consumed " << size << " bytes" << status()); - if (mayNeedMoreData()) - AsyncCall(91,5, this, BodyPipe::tellMoreBodySpaceAvailable); + if (mayNeedMoreData()){ + AsyncCallBase *call= new CallNoteBodyConsumer(theProducer, &BodyProducer::noteMoreBodySpaceAvailable, this, "BodyProducer::noteMoreBodySpaceAvailable"); + scheduleJob(91,5, call); + } } void @@ -253,7 +342,8 @@ { if (theConsumer || mustAutoConsume) { ++theCCallsPending; - AsyncCall(91,5, this, BodyPipe::tellMoreBodyDataAvailable); + AsyncCallBase *call= new CallNoteBodyProducer(theConsumer, &BodyConsumer::noteMoreBodyDataAvailable, this, "BodyConsumer::noteMoreBodyDataAvailable"); + scheduleJob(91,5, call); } } @@ -262,55 +352,17 @@ { if (theConsumer) { ++theCCallsPending; - if (bodySizeKnown() && bodySize() == thePutSize) - AsyncCall(91,5, this, BodyPipe::tellBodyProductionEnded); - else - AsyncCall(91,5, this, BodyPipe::tellBodyProducerAborted); + if (bodySizeKnown() && bodySize() == thePutSize) { + AsyncCallBase *call= new CallNoteBodyProducer(theConsumer, &BodyConsumer::noteBodyProductionEnded, this, "BodyConsumer::noteBodyProductionEnded"); + scheduleJob(91,5, call); + } + else{ + AsyncCallBase *call= new CallNoteBodyProducer(theConsumer, &BodyConsumer::noteBodyProducerAborted, this, "BodyConsumer::noteBodyProducerAborted"); + scheduleJob(91,5, call); + } } } -void BodyPipe::tellMoreBodySpaceAvailable() -{ - if (theProducer != NULL) - theProducer->noteMoreBodySpaceAvailable(*this); -} - -void BodyPipe::tellBodyConsumerAborted() -{ - if (theProducer != NULL) - theProducer->noteBodyConsumerAborted(*this); -} - -void BodyPipe::tellMoreBodyDataAvailable() -{ - if (skipCCall()) - return; - - if (theConsumer != NULL) - theConsumer->noteMoreBodyDataAvailable(*this); - else - if (mustAutoConsume && theBuf.hasContent()) - consume(theBuf.contentSize()); -} - -void BodyPipe::tellBodyProductionEnded() -{ - if (skipCCall()) - return; - - if (theConsumer != NULL) - theConsumer->noteBodyProductionEnded(*this); -} - -void BodyPipe::tellBodyProducerAborted() -{ - if (skipCCall()) - return; - - if (theConsumer != NULL) - theConsumer->noteBodyProducerAborted(*this); -} - // skips calls destined for the previous consumer; see BodyPipe::clearConsumer bool BodyPipe::skipCCall() { Index: squid3/src/BodyPipe.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/BodyPipe.h,v retrieving revision 1.5.4.1 retrieving revision 1.5.4.2 diff -u -r1.5.4.1 -r1.5.4.2 --- squid3/src/BodyPipe.h 23 Oct 2007 22:17:06 -0000 1.5.4.1 +++ squid3/src/BodyPipe.h 21 Nov 2007 21:59:38 -0000 1.5.4.2 @@ -16,9 +16,10 @@ BodyProducer():AsyncJob("BodyProducer"){} virtual ~BodyProducer() {} - virtual void noteMoreBodySpaceAvailable(BodyPipe &bp) = 0; - virtual void noteBodyConsumerAborted(BodyPipe &bp) = 0; + virtual void noteMoreBodySpaceAvailable(RefCount bp) = 0; + virtual void noteBodyConsumerAborted(RefCount bp) = 0; + bool ignoreLateConsumerNote(RefCount &bp); protected: void stopProducingFor(RefCount &pipe, bool atEof); }; @@ -32,10 +33,11 @@ BodyConsumer():AsyncJob("BodyConsumer"){} virtual ~BodyConsumer() {} - virtual void noteMoreBodyDataAvailable(BodyPipe &bp) = 0; - virtual void noteBodyProductionEnded(BodyPipe &bp) = 0; - virtual void noteBodyProducerAborted(BodyPipe &bp) = 0; + virtual void noteMoreBodyDataAvailable(RefCount bp) = 0; + virtual void noteBodyProductionEnded(RefCount bp) = 0; + virtual void noteBodyProducerAborted(RefCount bp) = 0; + bool ignoreLateProducerNote(RefCount &bp); protected: void stopConsumingFrom(RefCount &pipe); }; @@ -96,6 +98,7 @@ bool mayNeedMoreData() const { return !bodySizeKnown() || needsMoreData(); } bool needsMoreData() const { return bodySizeKnown() && unproducedSize() > 0; } uint64_t unproducedSize() const; // size of still unproduced data + bool checkProducer(Producer *aProducer) { return aProducer == theProducer;} // called by consumers bool setConsumerIfNotLate(Consumer *aConsumer); @@ -104,6 +107,7 @@ void consume(size_t size); bool expectMoreAfter(uint64_t offset) const; bool exhausted() const; // saw eof/abort and all data consumed + bool checkConsumer(Consumer *aConsumer) { return aConsumer == theConsumer;} // start or continue consuming when there is no consumer void enableAutoConsumption(); @@ -127,24 +131,6 @@ bool skipCCall(); // decides whether to skip the call, updates counters - public: /* public to enable callbacks, but treat as private */ - - /* these methods are calling producer and sibscriber note*() - * callbacks with this BodyPipe as a parameter, which allows - * a single producer or consumer to support multiple pipes. */ - - void tellMoreBodySpaceAvailable(); - void tellBodyConsumerAborted(); - void tellMoreBodyDataAvailable(); - void tellBodyProductionEnded(); - void tellBodyProducerAborted(); - - AsyncCallWrapper(91,5, BodyPipe, tellMoreBodySpaceAvailable); - AsyncCallWrapper(91,5, BodyPipe, tellBodyConsumerAborted); - AsyncCallWrapper(91,5, BodyPipe, tellMoreBodyDataAvailable); - AsyncCallWrapper(91,5, BodyPipe, tellBodyProductionEnded); - AsyncCallWrapper(91,5, BodyPipe, tellBodyProducerAborted); - private: int64_t theBodySize; // expected total content length, if known Producer *theProducer; // content producer, if any Index: squid3/src/Server.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Server.cc,v retrieving revision 1.20.4.3 retrieving revision 1.20.4.4 diff -u -r1.20.4.3 -r1.20.4.4 --- squid3/src/Server.cc 15 Nov 2007 19:49:58 -0000 1.20.4.3 +++ squid3/src/Server.cc 21 Nov 2007 21:59:38 -0000 1.20.4.4 @@ -1,5 +1,5 @@ /* - * $Id: Server.cc,v 1.20.4.3 2007/11/15 19:49:58 chtsanti Exp $ + * $Id: Server.cc,v 1.20.4.4 2007/11/21 21:59:38 chtsanti Exp $ * * DEBUG: * AUTHOR: Duane Wessels @@ -222,10 +222,10 @@ // more request or adapted response body is available void -ServerStateData::noteMoreBodyDataAvailable(BodyPipe &bp) +ServerStateData::noteMoreBodyDataAvailable(BodyPipe::Pointer bp) { #if ICAP_CLIENT - if (adaptedBodySource == &bp) { + if (adaptedBodySource == bp) { handleMoreAdaptedBodyAvailable(); return; } @@ -235,10 +235,10 @@ // the entire request or adapted response body was provided, successfully void -ServerStateData::noteBodyProductionEnded(BodyPipe &bp) +ServerStateData::noteBodyProductionEnded(BodyPipe::Pointer bp) { #if ICAP_CLIENT - if (adaptedBodySource == &bp) { + if (adaptedBodySource == bp) { handleAdaptedBodyProductionEnded(); return; } @@ -248,10 +248,10 @@ // premature end of the request or adapted response body production void -ServerStateData::noteBodyProducerAborted(BodyPipe &bp) +ServerStateData::noteBodyProducerAborted(BodyPipe::Pointer bp) { #if ICAP_CLIENT - if (adaptedBodySource == &bp) { + if (adaptedBodySource == bp) { handleAdaptedBodyProducerAborted(); return; } @@ -489,7 +489,7 @@ // can supply more virgin response body data void -ServerStateData::noteMoreBodySpaceAvailable(BodyPipe &) +ServerStateData::noteMoreBodySpaceAvailable(BodyPipe::Pointer) { if (responseBodyBuffer) { addVirginReplyBody(NULL, 0); // kick the buffered fragment alive again @@ -503,7 +503,7 @@ // the consumer of our virgin response body aborted void -ServerStateData::noteBodyConsumerAborted(BodyPipe &bp) +ServerStateData::noteBodyConsumerAborted(BodyPipe::Pointer) { stopProducingFor(virginBodyDestination, false); Index: squid3/src/Server.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/Server.h,v retrieving revision 1.10.4.4 retrieving revision 1.10.4.5 diff -u -r1.10.4.4 -r1.10.4.5 --- squid3/src/Server.h 13 Nov 2007 22:32:11 -0000 1.10.4.4 +++ squid3/src/Server.h 21 Nov 2007 21:59:38 -0000 1.10.4.5 @@ -1,6 +1,6 @@ /* - * $Id: Server.h,v 1.10.4.4 2007/11/13 22:32:11 chtsanti Exp $ + * $Id: Server.h,v 1.10.4.5 2007/11/21 21:59:38 chtsanti Exp $ * * AUTHOR: Duane Wessels * @@ -76,9 +76,9 @@ // BodyConsumer: consume request body or adapted response body. // The implementation just calls the corresponding HTTP or ICAP handle*() // method, depending on the pipe. - virtual void noteMoreBodyDataAvailable(BodyPipe &); - virtual void noteBodyProductionEnded(BodyPipe &); - virtual void noteBodyProducerAborted(BodyPipe &); + virtual void noteMoreBodyDataAvailable(BodyPipe::Pointer); + virtual void noteBodyProductionEnded(BodyPipe::Pointer); + virtual void noteBodyProducerAborted(BodyPipe::Pointer); // read response data from the network virtual void maybeReadVirginBody() = 0; @@ -98,8 +98,8 @@ virtual void noteIcapQueryAbort(bool final); // BodyProducer: provide virgin response body to ICAP. - virtual void noteMoreBodySpaceAvailable(BodyPipe &); - virtual void noteBodyConsumerAborted(BodyPipe &); + virtual void noteMoreBodySpaceAvailable(BodyPipe::Pointer ); + virtual void noteBodyConsumerAborted(BodyPipe::Pointer ); #endif virtual void processReplyBody() = 0; Index: squid3/src/client_side.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side.cc,v retrieving revision 1.139.4.1 retrieving revision 1.139.4.2 diff -u -r1.139.4.1 -r1.139.4.2 --- squid3/src/client_side.cc 23 Oct 2007 20:27:51 -0000 1.139.4.1 +++ squid3/src/client_side.cc 21 Nov 2007 21:59:38 -0000 1.139.4.2 @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.139.4.1 2007/10/23 20:27:51 chtsanti Exp $ + * $Id: client_side.cc,v 1.139.4.2 2007/11/21 21:59:38 chtsanti Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -2560,13 +2560,13 @@ } void -ConnStateData::noteMoreBodySpaceAvailable(BodyPipe &) +ConnStateData::noteMoreBodySpaceAvailable(BodyPipe::Pointer ) { handleRequestBodyData(); } void -ConnStateData::noteBodyConsumerAborted(BodyPipe &) +ConnStateData::noteBodyConsumerAborted(BodyPipe::Pointer ) { if (!closing()) startClosing("body consumer aborted"); Index: squid3/src/client_side.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side.h,v retrieving revision 1.22.4.3 retrieving revision 1.22.4.4 diff -u -r1.22.4.3 -r1.22.4.4 --- squid3/src/client_side.h 13 Nov 2007 22:32:11 -0000 1.22.4.3 +++ squid3/src/client_side.h 21 Nov 2007 21:59:38 -0000 1.22.4.4 @@ -1,6 +1,6 @@ /* - * $Id: client_side.h,v 1.22.4.3 2007/11/13 22:32:11 chtsanti Exp $ + * $Id: client_side.h,v 1.22.4.4 2007/11/21 21:59:38 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -205,8 +205,8 @@ void startClosing(const char *reason); BodyPipe::Pointer expectRequestBody(int64_t size); - virtual void noteMoreBodySpaceAvailable(BodyPipe &); - virtual void noteBodyConsumerAborted(BodyPipe &); + virtual void noteMoreBodySpaceAvailable(BodyPipe::Pointer); + virtual void noteBodyConsumerAborted(BodyPipe::Pointer); void handleReadData(char *buf, size_t size); void handleRequestBodyData(); Index: squid3/src/client_side_request.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side_request.cc,v retrieving revision 1.79.4.2 retrieving revision 1.79.4.3 diff -u -r1.79.4.2 -r1.79.4.3 --- squid3/src/client_side_request.cc 15 Nov 2007 19:49:58 -0000 1.79.4.2 +++ squid3/src/client_side_request.cc 21 Nov 2007 21:59:38 -0000 1.79.4.3 @@ -1,6 +1,6 @@ /* - * $Id: client_side_request.cc,v 1.79.4.2 2007/11/15 19:49:58 chtsanti Exp $ + * $Id: client_side_request.cc,v 1.79.4.3 2007/11/21 21:59:38 chtsanti Exp $ * * DEBUG: section 85 Client-side Request Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -1157,7 +1157,7 @@ } void -ClientHttpRequest::noteMoreBodyDataAvailable(BodyPipe &) +ClientHttpRequest::noteMoreBodyDataAvailable(BodyPipe::Pointer) { assert(request_satisfaction_mode); assert(icapBodySource != NULL); @@ -1178,7 +1178,7 @@ } void -ClientHttpRequest::noteBodyProductionEnded(BodyPipe &) +ClientHttpRequest::noteBodyProductionEnded(BodyPipe::Pointer) { assert(!icapHeadSource); if (icapBodySource != NULL) { // did not end request satisfaction yet @@ -1201,7 +1201,7 @@ } void -ClientHttpRequest::noteBodyProducerAborted(BodyPipe &) +ClientHttpRequest::noteBodyProducerAborted(BodyPipe::Pointer) { assert(!icapHeadSource); stopConsumingFrom(icapBodySource); Index: squid3/src/client_side_request.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/client_side_request.h,v retrieving revision 1.30.4.4 retrieving revision 1.30.4.5 diff -u -r1.30.4.4 -r1.30.4.5 --- squid3/src/client_side_request.h 13 Nov 2007 22:32:11 -0000 1.30.4.4 +++ squid3/src/client_side_request.h 21 Nov 2007 21:59:38 -0000 1.30.4.5 @@ -1,6 +1,6 @@ /* - * $Id: client_side_request.h,v 1.30.4.4 2007/11/13 22:32:11 chtsanti Exp $ + * $Id: client_side_request.h,v 1.30.4.5 2007/11/21 21:59:38 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -179,9 +179,9 @@ virtual void noteIcapQueryAbort(bool final); // BodyConsumer API, called by BodyPipe - virtual void noteMoreBodyDataAvailable(BodyPipe &); - virtual void noteBodyProductionEnded(BodyPipe &); - virtual void noteBodyProducerAborted(BodyPipe &); + virtual void noteMoreBodyDataAvailable(BodyPipe::Pointer); + virtual void noteBodyProductionEnded(BodyPipe::Pointer); + virtual void noteBodyProducerAborted(BodyPipe::Pointer); void endRequestSatisfaction(); Index: squid3/src/ICAP/ICAPModXact.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPModXact.cc,v retrieving revision 1.31.4.1 retrieving revision 1.31.4.2 diff -u -r1.31.4.1 -r1.31.4.2 --- squid3/src/ICAP/ICAPModXact.cc 22 Oct 2007 19:26:14 -0000 1.31.4.1 +++ squid3/src/ICAP/ICAPModXact.cc 21 Nov 2007 21:59:39 -0000 1.31.4.2 @@ -986,23 +986,17 @@ } // HTTP side added virgin body data -void ICAPModXact::noteMoreBodyDataAvailable(BodyPipe &) +void ICAPModXact::noteMoreBodyDataAvailable(BodyPipe::Pointer) { - ICAPXaction_Enter(noteMoreBodyDataAvailable); - writeMore(); if (state.sending == State::sendingVirgin) echoMore(); - - ICAPXaction_Exit(); } // HTTP side sent us all virgin info -void ICAPModXact::noteBodyProductionEnded(BodyPipe &) +void ICAPModXact::noteBodyProductionEnded(BodyPipe::Pointer) { - ICAPXaction_Enter(noteBodyProductionEnded); - Must(virgin.body_pipe->productionEnded()); // push writer and sender in case we were waiting for the last-chunk @@ -1010,16 +1004,12 @@ if (state.sending == State::sendingVirgin) echoMore(); - - ICAPXaction_Exit(); } // body producer aborted, but the initiator may still want to know // the answer, even though the HTTP message has been truncated -void ICAPModXact::noteBodyProducerAborted(BodyPipe &) +void ICAPModXact::noteBodyProducerAborted(BodyPipe::Pointer) { - ICAPXaction_Enter(noteBodyProducerAborted); - Must(virgin.body_pipe->productionEnded()); // push writer and sender in case we were waiting for the last-chunk @@ -1027,34 +1017,24 @@ if (state.sending == State::sendingVirgin) echoMore(); - - ICAPXaction_Exit(); } // adapted body consumer wants more adapted data and // possibly freed some buffer space -void ICAPModXact::noteMoreBodySpaceAvailable(BodyPipe &) +void ICAPModXact::noteMoreBodySpaceAvailable(BodyPipe::Pointer) { - ICAPXaction_Enter(noteMoreBodySpaceAvailable); - if (state.sending == State::sendingVirgin) echoMore(); else if (state.sending == State::sendingAdapted) parseMore(); else Must(state.sending == State::sendingUndecided); - - ICAPXaction_Exit(); } // adapted body consumer aborted -void ICAPModXact::noteBodyConsumerAborted(BodyPipe &) +void ICAPModXact::noteBodyConsumerAborted(BodyPipe::Pointer) { - ICAPXaction_Enter(noteBodyConsumerAborted); - mustStop("adapted body consumer aborted"); - - ICAPXaction_Exit(); } // internal cleanup Index: squid3/src/ICAP/ICAPModXact.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPModXact.h,v retrieving revision 1.9 retrieving revision 1.9.4.1 diff -u -r1.9 -r1.9.4.1 --- squid3/src/ICAP/ICAPModXact.h 13 Aug 2007 17:24:17 -0000 1.9 +++ squid3/src/ICAP/ICAPModXact.h 21 Nov 2007 21:59:39 -0000 1.9.4.1 @@ -1,6 +1,6 @@ /* - * $Id: ICAPModXact.h,v 1.9 2007/08/13 17:24:17 squidadm Exp $ + * $Id: ICAPModXact.h,v 1.9.4.1 2007/11/21 21:59:39 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -136,13 +136,13 @@ ICAPModXact(ICAPInitiator *anInitiator, HttpMsg *virginHeader, HttpRequest *virginCause, ICAPServiceRep::Pointer &s); // BodyProducer methods - virtual void noteMoreBodySpaceAvailable(BodyPipe &); - virtual void noteBodyConsumerAborted(BodyPipe &); + virtual void noteMoreBodySpaceAvailable(BodyPipe::Pointer); + virtual void noteBodyConsumerAborted(BodyPipe::Pointer); // BodyConsumer methods - virtual void noteMoreBodyDataAvailable(BodyPipe &); - virtual void noteBodyProductionEnded(BodyPipe &); - virtual void noteBodyProducerAborted(BodyPipe &); + virtual void noteMoreBodyDataAvailable(BodyPipe::Pointer); + virtual void noteBodyProductionEnded(BodyPipe::Pointer); + virtual void noteBodyProducerAborted(BodyPipe::Pointer); // comm handlers virtual void handleCommConnected();