BUG/MEDIUM: mux-h1: Always set CS_FL_EOI for response in MSG_DONE state
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 8 Feb 2021 16:18:01 +0000 (17:18 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 26 Feb 2021 15:54:29 +0000 (16:54 +0100)
commit621a0b5a398b9de1633381c69ca7657d30dcd72f
treebb295db87a3d2a33739d4bae67121ee17c9b8664
parent82282eb2452e8363b3b53cf2f69332a274be89c4
BUG/MEDIUM: mux-h1: Always set CS_FL_EOI for response in MSG_DONE state

During the message parsing, if in MSG_DONE state, the CS_FL_EOI flag must
always be set on the conn-stream if following conditions are met :

  * It is a response or
  * It is a request but not a protocol upgrade nor a CONNECT.

For now, there is no test on the message type (request or response). Thus
the CS_FL_EOI flag is not set for a response with a "Connection: upgrade"
header but not a 101 response.

This bug was introduced by the commit 3e1748bbf ("BUG/MINOR: mux-h1: Don't
set CS_FL_EOI too early for protocol upgrade requests"). It was backported
as far as 2.0. Thus, this patch must also be backported as far as 2.0.

(cherry picked from commit a22782b597ee9a3bfecb18a66e29633c8e814216)
[cf: context adjustments]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit d50c18f9c78d0ba0ff357c9a8b51941a8cda3441)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 9da31b5bfc5716f123567293fd579e54aff540e1)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/mux_h1.c