Calling virginBodySending.plan() has nothing to do with ICAP trailers
support. These (expensive!) plans are necessary if and only if we may
echo the virgin message back to Squid.
Since 6fbd6e, ICAP code always planned to echo the virgin body, even
when no echoing was needed. Echoing requires buffering the virgin
message body, so these plans stalled responses with bodies exceeding
~65K buffer capacity when, for example, the ICAP server did not respond
until getting the entire request body.
const bool allow204 = allow204in || allow204out;
const bool allow206 = allow206in || allow206out;
- if (!allow204 && !allow206 && !allowTrailers)
- return; // nothing to do
-
- if (virginBody.expected()) // if there is a virgin body, plan to send it
- virginBodySending.plan();
+ if ((allow204 || allow206) && virginBody.expected())
+ virginBodySending.plan(); // if there is a virgin body, plan to send it
// writing Preview:... means we will honor 204 inside preview
// writing Allow/204 means we will honor 204 outside preview