BUG/MEDIUM: stream: Properly handle abortonclose when set on backend only

Since the 2.2 and the commit dedd30610 ("MEDIUM: h1: Don't wake the H1 tasklet
if we got the whole request."), we avoid to subscribe for reads if the H1
message is fully received. However, this broke the abortonclose option. To fix
the issue, a CO_RFL flag was added to instruct the mux it should still wait for
read events to properly handle read0. Only the H1 mux was concerned.

But since then, most of time, the option is only handled if it is set on the
frontend proxy because the request is fully received before selecting the
backend. If the backend is selected before the end of the request there is no
issue. But otherwise, because the backend is not known yet, we are unable to
properly handle the option and we miss to subscribe for reads.

Of course the option cannot be set on a frontend proxy. So concretly it means
the option is properly handled if it is enabled in the defaults section (if
common to frontend and backend) or a listen proxy, but it is ignored if it is
set on backend only.

Thanks to previous patches, we can now instruct the mux it should subscribe for
reads if not already done. We use this mechanism in process_stream() when the
connection is set up, ie when backend SC is set to SC_ST_REQ state.

This patch relies on following patches:
  * MINOR: connection: Add a CTL flag to notify mux it should wait for reads again
  * MEDIUM: mux-h1: Handle MUX_SUBS_RECV flag in h1_ctl() and susbscribe for reads

This patch should be the issue #2344. All the series must be backported as far
as 2.2.

(cherry picked from commit 5ff7d2276788b1ba70493ea870ee97bf0d3b03ff)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 948a5a0a36ad237248fd683327905e7095d1051b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit a21f107869e7e486026cc552cb748bff5bad170b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit a794a6a7ddf94936576eecb11b713806e659ea67)
[cf: Adapted to get front connection]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed