--------------------- PatchSet 6201 Date: 2007/11/28 21:12:52 Author: chtsanti Branch: async-calls Tag: (none) Log: - Few words about BodySink, BodyProducerCall and BodyConsumerCall classes - other comments corrections/additions Members: src/AsyncCall.h:1.3.22.13->1.3.22.14 src/BodyPipe.cc:1.7.4.5->1.7.4.6 src/ICAP/ICAPXaction.cc:1.22.4.4->1.22.4.5 Index: squid3/src/AsyncCall.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/AsyncCall.h,v retrieving revision 1.3.22.13 retrieving revision 1.3.22.14 diff -u -r1.3.22.13 -r1.3.22.14 --- squid3/src/AsyncCall.h 27 Nov 2007 21:25:13 -0000 1.3.22.13 +++ squid3/src/AsyncCall.h 28 Nov 2007 21:12:52 -0000 1.3.22.14 @@ -1,6 +1,6 @@ /* - * $Id: AsyncCall.h,v 1.3.22.13 2007/11/27 21:25:13 chtsanti Exp $ + * $Id: AsyncCall.h,v 1.3.22.14 2007/11/28 21:12:52 chtsanti Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -122,7 +122,6 @@ // Now we add global templated functions that create the member function // wrappers above. These are for convenience: it is often easier to // call a templated function than to create a templated object. -// We need one function for each *MemFunT template. template NullaryMemFunT MemFun(C *object, Index: squid3/src/BodyPipe.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/BodyPipe.cc,v retrieving revision 1.7.4.5 retrieving revision 1.7.4.6 diff -u -r1.7.4.5 -r1.7.4.6 --- squid3/src/BodyPipe.cc 27 Nov 2007 19:34:54 -0000 1.7.4.5 +++ squid3/src/BodyPipe.cc 28 Nov 2007 21:12:52 -0000 1.7.4.6 @@ -4,6 +4,8 @@ CBDATA_CLASS_INIT(BodyPipe); +// BodySink is a BodyConsumer class which just consume and drops +// data from a BodyPipe class BodySink: public BodyConsumer { bool done; public: @@ -28,7 +30,9 @@ CBDATA_CLASS_INIT(BodySink); - +// The BodyProducerCall is an AsyncCall class which used to schedule BodyProducer calls. +// In addition to a normal AsyncCall checks if the BodyProducer is still the producer of +// the BodyPipe passed as argument class BodyProducerCall: public JobCallT< UnaryMemFunT > { @@ -50,7 +54,9 @@ } }; - +// The BodyConsumerCall is an AsyncCall class which used to schedule BodyConsumer calls. +// In addition to a normal AsyncCall checks if the BodyConsumer is still the reciptient +// of the BodyPipe passed as argument class BodyConsumerCall: public JobCallT< UnaryMemFunT > { @@ -263,6 +269,8 @@ postConsume(size); } +// In the AutoConsumption mode the consumer has gone but the producer continues +// producing data. We are using a BodySink BodyConsumer which just discards the produced data. void BodyPipe::enableAutoConsumption() { mustAutoConsume = true; Index: squid3/src/ICAP/ICAPXaction.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/ICAP/ICAPXaction.cc,v retrieving revision 1.22.4.4 retrieving revision 1.22.4.5 diff -u -r1.22.4.4 -r1.22.4.5 --- squid3/src/ICAP/ICAPXaction.cc 16 Nov 2007 19:08:15 -0000 1.22.4.4 +++ squid3/src/ICAP/ICAPXaction.cc 28 Nov 2007 21:12:52 -0000 1.22.4.5 @@ -40,6 +40,9 @@ ICAPXaction_fromData(data).noteCommClosed(); } +// XXX: This and similar wrappers used to handle exceptions and perform +// end-of-life checks. That code is now in AsyncCall. +// These wrappers will be gone once comm module supports AsyncCalls. static void ICAPXaction_noteCommConnected(int, comm_err_t status, int xerrno, void *data) {