MEDIUM: connections/mux: Add a recv and a send+recv wait list.

For struct connection, struct conn_stream, and for the h2 mux, add 2 new
lists, one that handles waiters for recv, and one that handles waiters for
recv and send. That way we can ask to subscribe for either recv or send.
diff --git a/include/proto/connection.h b/include/proto/connection.h
index ea6b17b..c7f2561 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -602,6 +602,8 @@
 	cs->flags = CS_FL_NONE;
 	LIST_INIT(&cs->wait_list.list);
 	LIST_INIT(&cs->send_wait_list);
+	LIST_INIT(&cs->recv_wait_list);
+	LIST_INIT(&cs->sendrecv_wait_list);
 	cs->conn = conn;
 	cs->wait_list.wait_reason = 0;
 }
@@ -629,6 +631,8 @@
 	conn->proxy_netns = NULL;
 	LIST_INIT(&conn->list);
 	LIST_INIT(&conn->send_wait_list);
+	LIST_INIT(&conn->recv_wait_list);
+	LIST_INIT(&conn->sendrecv_wait_list);
 }
 
 /* sets <owner> as the connection's owner */
@@ -711,8 +715,19 @@
 /* Releases a connection previously allocated by conn_new() */
 static inline void conn_free(struct connection *conn)
 {
-	LIST_DEL(&conn->send_wait_list);
-	LIST_INIT(&conn->send_wait_list);
+	struct wait_list *sw, *sw_back;
+	list_for_each_entry_safe(sw, sw_back, &conn->recv_wait_list, list) {
+		LIST_DEL(&sw->list);
+		LIST_INIT(&sw->list);
+	}
+	list_for_each_entry_safe(sw, sw_back, &conn->send_wait_list, list) {
+		LIST_DEL(&sw->list);
+		LIST_INIT(&sw->list);
+	}
+	list_for_each_entry_safe(sw, sw_back, &conn->sendrecv_wait_list, list) {
+		LIST_DEL(&sw->list);
+		LIST_INIT(&sw->list);
+	}
 	pool_free(pool_head_connection, conn);
 }
 
diff --git a/include/types/connection.h b/include/types/connection.h
index 9a1ba96..421df3c 100644
--- a/include/types/connection.h
+++ b/include/types/connection.h
@@ -375,6 +375,8 @@
 	struct connection *conn;             /* xprt-level connection */
 	struct wait_list wait_list;          /* We're in a wait list for send */
 	struct list send_wait_list;          /* list of tasks to wake when we're ready to send */
+	struct list recv_wait_list;          /* list of tasks to wake when we're ready to recv */
+	struct list sendrecv_wait_list;      /* list of tasks to wake when we're ready to either send or recv */
 	void *data;                          /* pointer to upper layer's entity (eg: stream interface) */
 	const struct data_cb *data_cb;       /* data layer callbacks. Must be set before xprt->init() */
 	void *ctx;                           /* mux-specific context */
@@ -406,6 +408,8 @@
 
 	/* second cache line */
 	struct list send_wait_list;   /* list of tasks to wake when we're ready to send */
+	struct list recv_wait_list;          /* list of tasks to wake when we're ready to recv */
+	struct list sendrecv_wait_list;      /* list of tasks to wake when we're ready to either send or recv */
 	struct list list;             /* attach point to various connection lists (idle, ...) */
 	int xprt_st;                  /* transport layer state, initialized to zero */
 	int tmp_early_data;           /* 1st byte of early data, if any */