BUG/MEDIUM: mux-h1: always apply the timeout on half-closed connections
authorWilly Tarreau <w@1wt.eu>
Tue, 8 Sep 2020 13:40:57 +0000 (15:40 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 11 Sep 2020 08:06:10 +0000 (10:06 +0200)
commit0cd374da0ab337b3f07f0423fbcb7c1ff0754e9b
tree5391f5c9f4b2189a2677a6a0542d2b554ecc9b79
parentd18d69e1e145e4afe5414366c853974298fef29d
BUG/MEDIUM: mux-h1: always apply the timeout on half-closed connections

The condition in h1_refresh_timeout() seems insufficient to properly
take care of the half-closed timeout, because depending on the ordering
of operations when performing the last send() to a client, the stream
may or may not still be there and we may fail to shrink the client
timeout on our last opportunity to do so.

Here we want to make sure that the timeout is always reduced when the
last chunk was sent and the shutdown completed, regardless of the
presence of a stream or not. This is what this patch does.

This should be backported as far as 2.0, and should fix the issue
reported in #541.

(cherry picked from commit 4313d5ae98b90613318da7e1181a6c4a1db29799)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit ee6ed47bba75896b6bbdd15f6a622e88a8168390)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/mux_h1.c