MEDIUM: mux-h1: Properly handle state transitions of chunked outgoing messages
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 26 Sep 2023 16:00:49 +0000 (18:00 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 Oct 2023 16:51:13 +0000 (18:51 +0200)
commitd57a66d63a5f545ef4c605b4ca186360c14c0929
tree36c972604178426bc1e5e594ade3a34f06312678
parent117f9cc0170085446211a99316c5697fcaf7766c
MEDIUM: mux-h1: Properly handle state transitions of chunked outgoing messages

On the sending path, there are 3 states for chunked payload in H1:

  * H1_MSG_CHUNK_SIZE: the chunk size must be emitted
  * H1_MSH_CHUNK_CRLF: The end of the chunk must be emitted
  * H1_MSG_DATA: Chunked data must be emitted

However, some shortcuts were used on the sending path to avoid some
transitions. Especially, outgoing messages were never switched in
H1_MSG_CHUNK_SIZE state.

However, it will be necessary to properly handle all transitions on the payload
to implement mux-to-mux forwarding, to be sure to always known when the chunk
size or the end of the chunk must be emitted.
src/mux_h1.c