MEDIUM: mux-h1: Handle MUX_SUBS_RECV flag in h1_ctl() and susbscribe for reads

The H1 mux now handle MUX_SUBS_RECV flag in h1_ctl(). If it is not already
subscribed for reads, it does so. This patch will be mandatory to properly
handle abortonclose option.

(cherry picked from commit 450ff71c955afc95111170f9245d83b50dd9db55)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 6d197f930c9c4224b28aa88cc9dc75977422eceb)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit ed1f7044fa316d5fd94d1acca7a824a62fa65be6)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit e4f10d5db200082db8630a485528190696d171dc)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/src/mux_h1.c b/src/mux_h1.c
index c16caf0..fe1e969 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -3652,7 +3652,7 @@
 
 static int h1_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *output)
 {
-	const struct h1c *h1c = conn->ctx;
+	struct h1c *h1c = conn->ctx;
 	int ret = 0;
 
 	switch (mux_ctl) {
@@ -3667,6 +3667,10 @@
 			 (h1c->errcode == 500 ? MUX_ES_INTERNAL_ERR :
 			  MUX_ES_SUCCESS))));
 		return ret;
+	case MUX_SUBS_RECV:
+		if (!(h1c->wait_event.events & SUB_RETRY_RECV))
+			h1c->conn->xprt->subscribe(h1c->conn, h1c->conn->xprt_ctx, SUB_RETRY_RECV, &h1c->wait_event);
+		return 0;
 	default:
 		return -1;
 	}