]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
If a consumer leaves without consuming anything, do not tell
authorrousskov <>
Tue, 8 May 2007 22:16:42 +0000 (22:16 +0000)
committerrousskov <>
Tue, 8 May 2007 22:16:42 +0000 (22:16 +0000)
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.

src/BodyPipe.cc

index fa1151a9c9f9d0776da9ebcf1c393694ffc82a88..9293bed36388f3cc496cf7b67d5fcdc503d08d46 100644 (file)
@@ -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);
        }
 }