]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: mux-h1: Add a dedicated enum to deal with H1 connection state
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 4 Oct 2022 15:13:32 +0000 (17:13 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 17 Nov 2022 13:33:14 +0000 (14:33 +0100)
commitef93be2a7b9a71492352266909ecb4a32cb52092
tree4955b1acf4f4e7127d01a17ccf0dbbad38aca1a2
parent71abc0cfd58e55391665f49dad8cf4707a49767a
MINOR: mux-h1: Add a dedicated enum to deal with H1 connection state

The H1 connection state will be handled is a dedicated field. To do so,
h1_cs enum was added. The different states are more or less equivalent to
H1C_F_ST_* flags:

 * H1_CS_IDLE      <=> H1C_F_ST_IDLE
 * H1_CS_EMBRYONIC <=> H1C_F_ST_EMBRYONIC
 * H1_CS_UPGRADING <=> H1C_F_ST_ATTACHED && !H1C_F_ST_READY
 * H1_CS_RUNNING   <=> H1C_F_ST_ATTACHED && H1C_F_ST_READY
 * H1_CS_CLOSING   <=> H1C_F_ST_SHUTDOWN && (H1C_F_ST_ATTACHED || b_data(&h1c->ibuf))
 * H1_CS_CLOSED    <=> H1C_F_ST_SHUTDOWN && !H1C_F_ST_ATTACHED && !b_data(&h1c->ibuf)

In addition, in this patch, the h1_is_alive() and h1_close() function are
added. The first one will be used to know if a H1 connection is alive or
not. The second one will be used to set the connection in CLOSING or CLOSED
state, depending on the output buffer state and if there is still a H1
stream or not.

For now, the H1 connection state is not used.
include/haproxy/mux_h1-t.h
src/mux_h1.c