From: rousskov <> Date: Tue, 8 May 2007 22:16:42 +0000 (+0000) Subject: If a consumer leaves without consuming anything, do not tell X-Git-Tag: SQUID_3_0_PRE6~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e71477f3a6f2cda3c217e12b1834d2ab1d05ffc1;p=thirdparty%2Fsquid.git If a consumer leaves without consuming anything, do not tell the producer that the consumer has aborted. This change increases the risk that, due to bugs, no [other] consumer will come and the producer will get stuck waiting for the buffer space. However, this risk should be mitigated by timeouts because no amount of code can ensure eventual consumer presence if producer and consumer are asynchronous. This change was needed to support ICAP transaction retries. When a transaction aborts due to pconn race conditions, without consuming body buffer, the second transaction will start from scratch and become the body consumer. --- diff --git a/src/BodyPipe.cc b/src/BodyPipe.cc index fa1151a9c9..9293bed363 100644 --- a/src/BodyPipe.cc +++ b/src/BodyPipe.cc @@ -145,7 +145,7 @@ BodyPipe::clearConsumer() { if (theConsumer) { debugs(91,7, HERE << "clearing consumer" << status()); theConsumer = NULL; - if (!exhausted()) + if (consumedSize() && !exhausted()) AsyncCall(91,5, this, BodyPipe::tellBodyConsumerAborted); } }