MINOR: htx: Add a noop block to carry the EOM flag on an empty message
A new HTX block type, HTX_BLK_NOOP, is added. It has the same traits as
the EOH and EOT blocks: a size of 1, to be able to wake the endpoint up
when it is emitted alone, but nothing is sent when a consumer encounters
it. It may carry the EOM flag and it is allowed anywhere in the message.
It is used by htx_set_eom() to report the end of an empty message: the
EOM flag was previously carried by an EOT block in this case, which was
misleading, an end-of-trailers block carrying no data. As a consequence,
an EOT block without the EOM flag is now a valid state, the message is
simply not ended. This must be handled by all the consumers, especially
the muxes:
- The H1 mux skips the NOOP blocks and, when one carries the EOM flag,
it reports the end of the message exactly like a last DATA block. An
EOT block without the EOM flag still ends the message framing, as
before: on the wire, the trailers terminate a chunked message, there
is nothing to add after them.
- The H2 mux skips the NOOP blocks and, when one carries the EOM flag,
it emits an empty DATA frame with the END_STREAM flag and closes the
stream. For a trailers frame, the END_STREAM flag is now only set
when the EOT block carries the EOM flag, and the stream is only
closed in this case. An EOT block without the EOM flag means the
message is not finished and more data may follow.
- The H3 mux skips the NOOP blocks and, when one carries the EOM flag,
it sets the fin flag on the stream. Like the H2 mux, the fin flag is
only reported for an EOT block carrying the EOM flag.
- The FCGI mux skips the NOOP blocks and, when one carries the EOM
flag, it emits an empty STDIN record to signal the end of the request.
All the other consumers, the filters, the applets, the sample fetches and
the health-checks, were audited: they either ignore the unknown block
types or stop their walk on the block carrying the EOM flag, so a NOOP
block is properly handled by all of them.
There is no need to backport this patch, it is an enabler for future uses.