]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mux-h1: Don't emit 0-CRLF chunk in h1_done_ff() when iobuf is empty
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 21 Feb 2024 08:30:46 +0000 (09:30 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 21 Feb 2024 10:49:58 +0000 (11:49 +0100)
commit1a2a196fcffebd77d853c843ebc599ffec6dc3aa
tree27f57896d15897026b6e231e35324b4b64376df4
parenta17eaf7763010da953c8e98e45e345dce38a6523
BUG/MEDIUM: mux-h1: Don't emit 0-CRLF chunk in h1_done_ff() when iobuf is empty

A chunk message transferred via zero-copy forwarding in H1 may be
corrupted. This only happens when the chunk size is not known during the
nego stage and when there is nothing to forward when h1_donn_ff() is
called. In this case, we always emit a chunk. Because there is nothing to
forward, a 0-CRLF is emitted in the middle of the message.

The issue occurred with the HTTP stats applet only.

A simple fix is to check the size of data in the iobuf before emitting a new
chunk in h1_done_ff(). However, we still try to send outgoing data because
when this happens, it is most of time because the H1 output buffer is almost
full.

This patch should fix the issue #2453. No backport needed.
src/mux_h1.c