MEDIUM: mux-h1: Don't block reads when waiting for the other side
When we are waiting for the other side to read more data, or to read the
next request, we must only stop the processing of input data and not the
data receipt. This patch don't change anything on the subscribes for
reads. So it should not change anything. The only difference is that the H1
connection will try to read data if it is woken up for an I/O event and if
it was subscribed for reads.
This patch is required to fix abortonclose option for H1 client connections.
(cherry picked from commit ec4207cb68b1d7d50e06d35aaa73586e2c7d46b0)
[Cf: H1C_F_IN_BUSY flag is used instead of H1C_F_WAIT_OUTPUT]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 655205413a779da086def0365d7a567cf37c2642)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit a325112ff883e306ff115a8dff4ef7070e990791)
[Cf: commits 44410b03a ("MINOR: conn-stream: Force mux to wait for read events
if abortonclose is set") and c4f8ce7c3 ("BUG/MEDIUM: mux-h1: Properly
report client close if abortonclose option is set") are ignored because
mux-h1 wakeups and subscribes are now handled the same way. This one is
enough to fix abortonclose option.]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/mux_h1.c b/src/mux_h1.c
index bfcdffc..c46146f 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -159,7 +159,7 @@
if (h1c->conn->flags & (CO_FL_ERROR|CO_FL_SOCK_RD_SH))
return 0;
- if (!(h1c->flags & (H1C_F_IN_ALLOC|H1C_F_IN_FULL|H1C_F_IN_BUSY)))
+ if (!(h1c->flags & (H1C_F_IN_ALLOC|H1C_F_IN_FULL)))
return 1;
return 0;
@@ -1514,6 +1514,9 @@
if (h1s->flags & errflag)
goto end;
+ if (h1c->flags & H1C_F_IN_BUSY)
+ goto end;
+
do {
size_t used = htx_used_space(htx);