BUG/MINOR: mux-h1: Fix data skipping for bodyless responses
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 8 Feb 2021 14:56:36 +0000 (15:56 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 10 Feb 2021 15:25:42 +0000 (16:25 +0100)
commit0d7e634631dd96378256d5783f6876169558b7f2
tree4e6ae1f9cb31a1c451a6416f03e773520b37c92b
parenta22782b597ee9a3bfecb18a66e29633c8e814216
BUG/MINOR: mux-h1: Fix data skipping for bodyless responses

When payload is received for a bodyless response, for instance a response to
a HEAD request, it is silently skipped. Unfortunately, when this happens,
the end of the message is not properly handled. The response remains in the
MSG_DATA state (or MSG_TRAILERS if the message is chunked). In addition,
when a zero-copy is possible, the data are not removed from the channel
buffer and the H1 connection is killed because an error is then triggered.

To fix the bug, the zero-copy is disabled for bodyless responses. It is not
a problem because there is no copy at all. And the last block (DATA or EOT)
is now properly handled.

This bug was introduced by the commit e5596bf53 ("MEDIUM: mux-h1: Don't emit
any payload for bodyless responses").

This fix is specific for 2.4. No backport needed.
src/mux_h1.c