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);
 }