MAJOR: mux-h1/proto_htx: Handle keep-alive connections in the mux

Now, the connection mode is detected in the mux and not in HTX analyzers
anymore. Keep-alive connections are now managed by the mux. A new stream is
created for each transaction. This removes the most important part of the
synchronization between channels and the HTTP transaction cleanup. These changes
only affect the HTX part (proto_htx.c). Legacy HTTP analyzers remain untouched
for now.

On the client-side, the mux is responsible to create new streams when a new
request starts. It is also responsible to parse and update the "Connection:"
header of the response. On the server-side, the mux is responsible to parse and
update the "Connection:" header of the request. Muxes on each side are
independent. For now, there is no connection pool on the server-side, so it
always close the server connection.
diff --git a/src/proto_http.c b/src/proto_http.c
index face0bf..bd4221a 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -790,6 +790,9 @@
 	struct proxy *fe = strm_fe(s);
 	int tmp = TX_CON_WANT_KAL;
 
+	if (IS_HTX_STRM(s))
+		return htx_adjust_conn_mode(s, txn, msg);
+
 	if ((fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_TUN ||
 	    (s->be->options & PR_O_HTTP_MODE) == PR_O_HTTP_TUN)
 		tmp = TX_CON_WANT_TUN;
@@ -2563,6 +2566,9 @@
 	struct buffer *chunk;
 	int ret = 0;
 
+	if (IS_HTX_STRM(s))
+		return htx_apply_redirect_rule(rule, s, txn);
+
 	chunk = alloc_trash_chunk();
 	if (!chunk)
 		goto leave;
@@ -7657,8 +7663,11 @@
 {
 	struct http_txn *txn = s->txn;
 	struct proxy *fe = strm_fe(s);
+	struct conn_stream *cs = objt_cs(s->si[0].end);
 
-	txn->flags = 0;
+	txn->flags = ((cs && cs->flags & CS_FL_NOT_FIRST)
+		      ? (TX_NOT_FIRST|TX_WAIT_NEXT_RQ)
+		      : 0);
 	txn->status = -1;
 
 	txn->cookie_first_date = 0;