BUG/MEDIUM: mux-h2: Properly handle shutdowns when received with data
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 23 Apr 2021 10:25:18 +0000 (12:25 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 29 Apr 2021 09:11:19 +0000 (11:11 +0200)
commitc54c03ecec777b483568cbdae703ba7fc2f00bb1
tree7e829e00cfba69dfdc478d5875f6e54c45a188ad
parent57af25c6070829a490f32adae1fb23c7cfa5d98d
BUG/MEDIUM: mux-h2: Properly handle shutdowns when received with data

The H2_CF_RCVD_SHUT flag is used to report a read0 was encountered. It is
used by the H2 mux to properly handle shutdowns. However, this flag is only
set when no data are received. If it is detected at the socket level when
some data are received, it is not handled. And because the event was
reported on the connection, any other read attempts are blocked. In this
case, we are unable to close the connection and release the mux
immediately. We must wait the mux timeout expires.

This patch should fix the issue #1231. It must be backported as far as 2.0.

(cherry picked from commit de9d605aa56d257e3720f080a8c7f30b54fa6543)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 74b7411f3e710c5ccd648db2c316f48204a979b4)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 833c36ff8355850cc7b6fb7822af92123ceb44c1)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/mux_h2.c