CLEANUP: connection: rename conn->mux_ctx to conn->ctx

We most often store the mux context there but it can also be something
else while setting up the connection. Better call it "ctx" and know
that it's the owner's context than misleadingly call it mux_ctx and
get caught doing suspicious tricks.
diff --git a/include/proto/connection.h b/include/proto/connection.h
index 05148bb..441b51d 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -520,7 +520,7 @@
 	conn->mux  = NULL;
 	conn->xprt_st = 0;
 	conn->xprt_ctx = NULL;
-	conn->mux_ctx = NULL;
+	conn->ctx = NULL;
 }
 
 /*
@@ -545,7 +545,7 @@
 	conn->tmp_early_data = -1;
 	conn->sent_early_data = 0;
 	conn->mux = NULL;
-	conn->mux_ctx = NULL;
+	conn->ctx = NULL;
 	conn->owner = NULL;
 	conn->send_proxy_ofs = 0;
 	conn->handle.fd = DEAD_FD_MAGIC;
@@ -672,8 +672,8 @@
 	/* If we temporarily stored the connection as the stream_interface's
 	 * end point, remove it.
 	 */
-	if (conn->mux_ctx != NULL && conn->mux == NULL) {
-		struct stream *s = conn->mux_ctx;
+	if (conn->ctx != NULL && conn->mux == NULL) {
+		struct stream *s = conn->ctx;
 
 		if (objt_conn(s->si[1].end) == conn)
 			s->si[1].end = NULL;
@@ -823,7 +823,7 @@
                                    void *ctx, struct proxy *prx, struct session *sess)
 {
 	conn->mux = mux;
-	conn->mux_ctx = ctx;
+	conn->ctx = ctx;
 	return mux->init ? mux->init(conn, prx, sess) : 0;
 }
 
diff --git a/include/types/connection.h b/include/types/connection.h
index 430e92a..f1fd7a0 100644
--- a/include/types/connection.h
+++ b/include/types/connection.h
@@ -429,7 +429,7 @@
 	const struct xprt_ops *xprt;  /* operations at the transport layer */
 	const struct mux_ops  *mux;   /* mux layer opreations. Must be set before xprt->init() */
 	void *xprt_ctx;               /* general purpose pointer, initialized to NULL */
-	void *mux_ctx;                /* mux-specific context, initialized to NULL */
+	void *ctx;                    /* highest level context (usually the mux), initialized to NULL */
 	void *owner;                  /* pointer to the owner session, or NULL */
 	enum obj_type *target;        /* the target to connect to (server, proxy, applet, ...) */
 
diff --git a/src/backend.c b/src/backend.c
index 64bea0a..237668c 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1057,7 +1057,7 @@
 static int conn_complete_server(struct connection *conn)
 {
 	struct conn_stream *cs = NULL;
-	struct stream *s = conn->mux_ctx;
+	struct stream *s = conn->ctx;
 	struct server *srv;
 
 	task_wakeup(s->task, TASK_WOKEN_IO);
@@ -1338,7 +1338,7 @@
 		}
 #if defined(USE_OPENSSL) && defined(TLSEXT_TYPE_application_layer_protocol_negotiation)
 		else {
-			srv_conn->mux_ctx = s;
+			srv_conn->ctx = s;
 			/* Store the connection into the stream interface,
 			 * while we still don't have a mux, so that if the
 			 * stream is destroyed before the connection is
diff --git a/src/cli.c b/src/cli.c
index ae419b0..cc377fc 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -897,7 +897,7 @@
 		if (fdt.iocb == conn_fd_handler) {
 			conn_flags = ((struct connection *)fdt.owner)->flags;
 			mux = ((struct connection *)fdt.owner)->mux;
-			ctx = ((struct connection *)fdt.owner)->mux_ctx;
+			ctx = ((struct connection *)fdt.owner)->ctx;
 			li = objt_listener(((struct connection *)fdt.owner)->target);
 			sv = objt_server(((struct connection *)fdt.owner)->target);
 			px = objt_proxy(((struct connection *)fdt.owner)->target);
@@ -945,7 +945,7 @@
 				chunk_appendf(&trash, " fe=%s", li->bind_conf->frontend->id);
 
 			if (mux) {
-				chunk_appendf(&trash, " mux=%s mux_ctx=%p", mux->name, ctx);
+				chunk_appendf(&trash, " mux=%s ctx=%p", mux->name, ctx);
 				if (mux->show_fd)
 					mux->show_fd(&trash, fdt.owner);
 			}
diff --git a/src/mux_h1.c b/src/mux_h1.c
index bca4773..84d8ce5 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -204,7 +204,7 @@
 
 static int h1_avail_streams(struct connection *conn)
 {
-	struct h1c *h1c = conn->mux_ctx;
+	struct h1c *h1c = conn->ctx;
 
 	return h1c->h1s ? 0 : 1;
 }
@@ -345,7 +345,7 @@
 }
 
 /*
- * Initialize the mux once it's attached. It is expected that conn->mux_ctx
+ * Initialize the mux once it's attached. It is expected that conn->ctx
  * points to the existing conn_stream (for outgoing connections) or NULL (for
  * incoming ones). Returns < 0 on error.
  */
@@ -376,10 +376,10 @@
 		h1c->flags |= H1C_F_CS_WAIT_CONN;
 
 	/* Always Create a new H1S */
-	if (!h1s_create(h1c, conn->mux_ctx, sess))
+	if (!h1s_create(h1c, conn->ctx, sess))
 		goto fail;
 
-	conn->mux_ctx = h1c;
+	conn->ctx = h1c;
 
 	/* Try to read, if nothing is available yet we'll just subscribe */
 	if (h1_recv(h1c))
@@ -402,7 +402,7 @@
  */
 static void h1_release(struct connection *conn)
 {
-	struct h1c *h1c = conn->mux_ctx;
+	struct h1c *h1c = conn->ctx;
 
 	LIST_DEL(&conn->list);
 
@@ -428,7 +428,7 @@
 	}
 
 	conn->mux = NULL;
-	conn->mux_ctx = NULL;
+	conn->ctx = NULL;
 
 	conn_stop_tracking(conn);
 	conn_full_close(conn);
@@ -1780,7 +1780,7 @@
 	struct connection *conn = h1c->conn;
 	struct h1s *h1s = h1c->h1s;
 
-	if (!conn->mux_ctx)
+	if (!conn->ctx)
 		return -1;
 
 	if (h1c->flags & H1C_F_CS_WAIT_CONN) {
@@ -1843,7 +1843,7 @@
 
 static void h1_reset(struct connection *conn)
 {
-	struct h1c *h1c = conn->mux_ctx;
+	struct h1c *h1c = conn->ctx;
 
 	/* Reset the flags, and let the mux know we're waiting for a connection */
 	h1c->flags = H1C_F_CS_WAIT_CONN;
@@ -1851,7 +1851,7 @@
 
 static int h1_wake(struct connection *conn)
 {
-	struct h1c *h1c = conn->mux_ctx;
+	struct h1c *h1c = conn->ctx;
 	int ret;
 
 	h1_send(h1c);
@@ -1874,7 +1874,7 @@
  */
 static struct conn_stream *h1_attach(struct connection *conn, struct session *sess)
 {
-	struct h1c *h1c = conn->mux_ctx;
+	struct h1c *h1c = conn->ctx;
 	struct conn_stream *cs = NULL;
 	struct h1s *h1s;
 
@@ -1900,7 +1900,7 @@
  */
 static const struct conn_stream *h1_get_first_cs(const struct connection *conn)
 {
-	struct h1c *h1c = conn->mux_ctx;
+	struct h1c *h1c = conn->ctx;
 	struct h1s *h1s = h1c->h1s;
 
 	if (h1s)
@@ -1911,7 +1911,7 @@
 
 static void h1_destroy(struct connection *conn)
 {
-	struct h1c *h1c = conn->mux_ctx;
+	struct h1c *h1c = conn->ctx;
 
 	if (!h1c->h1s)
 		h1_release(conn);
@@ -2031,7 +2031,7 @@
 
 static void h1_shutw_conn(struct connection *conn)
 {
-	struct h1c *h1c = conn->mux_ctx;
+	struct h1c *h1c = conn->ctx;
 
 	if (conn_xprt_ready(conn) && conn->xprt->shutw)
 		conn->xprt->shutw(conn, 1);
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 499e423..cec3576 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -355,7 +355,7 @@
 
 static int h2_avail_streams(struct connection *conn)
 {
-	struct h2c *h2c = conn->mux_ctx;
+	struct h2c *h2c = conn->ctx;
 
 	/* XXX Should use the negociated max concurrent stream nb instead of the conf value */
 	return (h2_settings_max_concurrent_streams - h2c->nb_streams);
@@ -386,7 +386,7 @@
 	if (!h2c)
 		goto fail_no_h2c;
 
-	if (conn->mux_ctx) {
+	if (conn->ctx) {
 		h2c->flags = H2_CF_IS_BACK;
 		h2c->shut_timeout = h2c->timeout = prx->timeout.server;
 		if (tick_isset(prx->timeout.serverfin))
@@ -454,16 +454,16 @@
 		/* FIXME: this is temporary, for outgoing connections we need
 		 * to immediately allocate a stream until the code is modified
 		 * so that the caller calls ->attach(). For now the outgoing cs
-		 * is stored as conn->mux_ctx by the caller.
+		 * is stored as conn->ctx by the caller.
 		 */
 		struct h2s *h2s;
 
-		h2s = h2c_bck_stream_new(h2c, conn->mux_ctx, sess);
+		h2s = h2c_bck_stream_new(h2c, conn->ctx, sess);
 		if (!h2s)
 			goto fail_stream;
 	}
 
-	conn->mux_ctx = h2c;
+	conn->ctx = h2c;
 
 	/* prepare to read something */
 	tasklet_wakeup(h2c->wait_event.task);
@@ -514,7 +514,7 @@
  */
 static void h2_release(struct connection *conn)
 {
-	struct h2c *h2c = conn->mux_ctx;
+	struct h2c *h2c = conn->ctx;
 
 	LIST_DEL(&conn->list);
 
@@ -543,7 +543,7 @@
 	}
 
 	conn->mux = NULL;
-	conn->mux_ctx = NULL;
+	conn->ctx = NULL;
 
 	conn_stop_tracking(conn);
 	conn_full_close(conn);
@@ -2694,7 +2694,7 @@
 
 static int h2_wake(struct connection *conn)
 {
-	struct h2c *h2c = conn->mux_ctx;
+	struct h2c *h2c = conn->ctx;
 
 	return (h2_process(h2c));
 }
@@ -2765,7 +2765,7 @@
 {
 	struct conn_stream *cs;
 	struct h2s *h2s;
-	struct h2c *h2c = conn->mux_ctx;
+	struct h2c *h2c = conn->ctx;
 
 	cs = cs_new(conn);
 	if (!cs)
@@ -2785,7 +2785,7 @@
  */
 static const struct conn_stream *h2_get_first_cs(const struct connection *conn)
 {
-	struct h2c *h2c = conn->mux_ctx;
+	struct h2c *h2c = conn->ctx;
 	struct h2s *h2s;
 	struct eb32_node *node;
 
@@ -2804,7 +2804,7 @@
  */
 static void h2_destroy(struct connection *conn)
 {
-	struct h2c *h2c = conn->mux_ctx;
+	struct h2c *h2c = conn->ctx;
 
 	if (eb_is_empty(&h2c->streams_by_id))
 		h2_release(h2c->conn);
@@ -4854,7 +4854,7 @@
 /* for debugging with CLI's "show fd" command */
 static void h2_show_fd(struct buffer *msg, struct connection *conn)
 {
-	struct h2c *h2c = conn->mux_ctx;
+	struct h2c *h2c = conn->ctx;
 	struct h2s *h2s = NULL;
 	struct eb32_node *node;
 	int fctl_cnt = 0;
diff --git a/src/mux_pt.c b/src/mux_pt.c
index 43c3f6f..da1c343 100644
--- a/src/mux_pt.c
+++ b/src/mux_pt.c
@@ -33,7 +33,7 @@
 	conn_full_close(conn);
 	tasklet_free(ctx->wait_event.task);
 	conn->mux = NULL;
-	conn->mux_ctx = NULL;
+	conn->ctx = NULL;
 	if (conn->destroy_cb)
 		conn->destroy_cb(conn);
 	/* We don't bother unsubscribing here, as we're about to destroy
@@ -58,14 +58,14 @@
 	return NULL;
 }
 
-/* Initialize the mux once it's attached. It is expected that conn->mux_ctx
+/* Initialize the mux once it's attached. It is expected that conn->ctx
  * points to the existing conn_stream (for outgoing connections) or NULL (for
  * incoming ones, in which case one will be allocated and a new stream will be
  * instanciated). Returns < 0 on error.
  */
 static int mux_pt_init(struct connection *conn, struct proxy *prx, struct session *sess)
 {
-	struct conn_stream *cs = conn->mux_ctx;
+	struct conn_stream *cs = conn->ctx;
 	struct mux_pt_ctx *ctx = pool_alloc(pool_head_pt_ctx);
 
 	if (!ctx)
@@ -88,7 +88,7 @@
 			goto fail_free;
 
 	}
-	conn->mux_ctx = ctx;
+	conn->ctx = ctx;
 	ctx->cs = cs;
 	cs->flags |= CS_FL_RCV_MORE;
 	return 0;
@@ -108,7 +108,7 @@
  */
 static int mux_pt_wake(struct connection *conn)
 {
-	struct mux_pt_ctx *ctx = conn->mux_ctx;
+	struct mux_pt_ctx *ctx = conn->ctx;
 	struct conn_stream *cs = ctx->cs;
 	int ret = 0;
 
@@ -141,7 +141,7 @@
 static struct conn_stream *mux_pt_attach(struct connection *conn, struct session *sess)
 {
 	struct conn_stream *cs;
-	struct mux_pt_ctx *ctx = conn->mux_ctx;
+	struct mux_pt_ctx *ctx = conn->ctx;
 
 	conn->xprt->unsubscribe(conn, SUB_RETRY_RECV, &ctx->wait_event);
 	cs = cs_new(conn);
@@ -160,7 +160,7 @@
  */
 static const struct conn_stream *mux_pt_get_first_cs(const struct connection *conn)
 {
-	struct mux_pt_ctx *ctx = conn->mux_ctx;
+	struct mux_pt_ctx *ctx = conn->ctx;
 	struct conn_stream *cs = ctx->cs;
 
 	return cs;
@@ -169,7 +169,7 @@
 /* Destroy the mux and the associated connection, if no longer used */
 static void mux_pt_destroy_meth(struct connection *conn)
 {
-	struct mux_pt_ctx *ctx = conn->mux_ctx;
+	struct mux_pt_ctx *ctx = conn->ctx;
 
 	if (!(ctx->cs))
 		mux_pt_destroy(ctx);
@@ -181,7 +181,7 @@
 static void mux_pt_detach(struct conn_stream *cs)
 {
 	struct connection *conn = cs->conn;
-	struct mux_pt_ctx *ctx = cs->conn->mux_ctx;
+	struct mux_pt_ctx *ctx = cs->conn->ctx;
 
 	/* Subscribe, to know if we got disconnected */
 	if (conn->owner != NULL &&
@@ -195,7 +195,7 @@
 
 static int mux_pt_avail_streams(struct connection *conn)
 {
-	struct mux_pt_ctx *ctx = conn->mux_ctx;
+	struct mux_pt_ctx *ctx = conn->ctx;
 
 	return (ctx->cs == NULL ? 1 : 0);
 }