]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: http-htx: Properly set htx flags on error files to support keep-alive
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 16 Oct 2019 07:09:04 +0000 (09:09 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 16 Oct 2019 08:03:12 +0000 (10:03 +0200)
commit0d4ce93fcf9bd1f350c95f5a1bbe403bce57c680
treed520d438b7c95816445f641991afcd20797f12da
parentabefa34c344b7aa2c38654664c2dd170d50e3b2e
BUG/MINOR: http-htx: Properly set htx flags on error files to support keep-alive

When an error file was loaded, the flag HTX_SL_F_XFER_LEN was never set on the
HTX start line because of a bug. During the headers parsing, the flag
H1_MF_XFER_LEN is never set on the h1m. But it was the condition to set
HTX_SL_F_XFER_LEN on the HTX start-line. Instead, we must only rely on the flags
H1_MF_CLEN or H1_MF_CHNK.

Because of this bug, it was impossible to keep a connection alive for a response
generated by HAProxy. Now the flag HTX_SL_F_XFER_LEN is set when an error file
have a content length (chunked responses are unsupported at this stage) and the
connection may be kept alive if there is no connection header specified to
explicitly close it.

This patch must be backported to 2.0 and 1.9.
src/http_htx.c