BUG/MINOR: connection: Fix fc_http_major and bc_http_major for TCP connections
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 14 Apr 2021 13:40:30 +0000 (15:40 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 29 Apr 2021 09:08:05 +0000 (11:08 +0200)
commitac78a608d4dd9801ec81ba879871a776af9a9f15
treef7a3c3c225fe94fc4d004b35e2d837fdc6279616
parent6956b15da0412d44b84a5c73b1f91ac51dd611f8
BUG/MINOR: connection: Fix fc_http_major and bc_http_major for TCP connections

fc_http_major and bc_http_major sample fetches return the major digit of the
HTTP version used, respectively, by the frontend and the backend
connections, based on the mux. However, in reality, "2" is returned if the
H2 mux is detected, otherwise "1" is inconditionally returned, regardless
the mux used. Thus, if called for a raw TCP connection, "1" is returned.

To fix this bug, we now get the multiplexer flags, if there is one, to be
sure MX_FL_HTX is set.

I guess it was made this way on purpose when the H2 multiplexer was
introduced in the 1.8 and with the legacy HTTP mode there is no other
solution at the connection level. Thus this patch should be backported as
far as 2.2. For the 2.0, it must be evaluated first because of the legacy
HTTP mode.

(cherry picked from commit f4dd9ae5c7ca65cd5c2652343e4af5ca7a97ab32)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 5dfe7dccd4b4051256e30d4652a6b889e73e2239)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 83432e50147dc4ba7cb201452939c03f5a6ae375)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/connection.c