When an ICAP REQMOD service responds with an error to
(or the REQMOD transaction aborts while processing) a large HTTP
request, the HTTP request may get stuck because the request body
buffer gets full and nobody consumes the no-longer-needed content.
The ICAP code quits but leaves the body buffer intact in case the
client-side code wants to bypass the error. After that, nobody consumes
the request body because the buggy client side does not inform the body
pipe that there will be no other consumers, which would have triggered
a noteBodyConsumerAborted() callback and enable auto-consumption or closed
the client connection.
This is a Measurement Factory project
bodyPipe->enableAutoConsumption();
}
+void
+ConnStateData::expectNoForwarding() {
+ if (bodyPipe != NULL) {
+ debugs(33, 4, HERE << "no consumer for virgin body " << bodyPipe->status());
+ bodyPipe->expectNoConsumption();
+ }
+}
+
/// initialize dechunking state
void
ConnStateData::startDechunkingRequest()
bool closing() const;
void startClosing(const char *reason);
+ void expectNoForwarding(); ///< cleans up virgin request [body] forwarding state
BodyPipe::Pointer expectRequestBody(int64_t size);
virtual void noteMoreBodySpaceAvailable(BodyPipe::Pointer);
request->detailError(ERR_ICAP_FAILURE, errDetail);
c->flags.readMore = true;
+ c->expectNoForwarding();
node = (clientStreamNode *)client_stream.tail->data;
clientStreamRead(node, this, node->readBuffer);
}