BUG/MEDIUM: cache: report the end of message via HTX after a zero-copy forwarding
Since the commit
c061ba30f ("MAJOR: cache: Send cached objects using
zero-copy forwarding"), when all the payload of a cached object was sent
using the zero-copy forwarding, the end of the message was directly
reported by http_cache_fastfwd(), by setting the EOI and EOS flags on the
applet. The end of the message was then only reported to the consumer via
the IOBUF_FL_EOI flag. But the H1 mux does not emit the last chunk in
that case. So, for an object ending on a DATA block (typically from an
H2 origin without content-length) and too large to be sent at once with
its headers, the response was sent chunked to HTTP/1.1 clients without
its last chunk, and every cache hit failed. The H2 and H3 muxes were not
affected because they set the END_STREAM flag on the last DATA frame. And
objects ending on an EOT block were not affected either because the
zero-copy forwarding stops on this block.
Now, http_cache_fastfwd() only disables the zero-copy forwarding when all
the payload was forwarded, like the stats applet does. The end of the
message is then reported by the I/O handler via the HTX message, by
setting the EOM flag. So the consumer can properly finish the message.
A reg-test was added, with an H2 origin and HTTP/1.1 clients.
This patch must be backported as far as 3.0.