CLEANUP: conn_stream: rename the cs_endpoint's context to "conn"
This one is exclusively used by the connection, regardless its generic
name "ctx" is rather confusing. Let's make it a struct connection* and
call it "conn". This way there's no doubt about what it is and there's
no way it will be used by accident by being taken for something else.
diff --git a/src/conn_stream.c b/src/conn_stream.c
index 772feb9..9147eda 100644
--- a/src/conn_stream.c
+++ b/src/conn_stream.c
@@ -85,7 +85,7 @@
void cs_endpoint_init(struct cs_endpoint *endp)
{
endp->target = NULL;
- endp->ctx = NULL;
+ endp->conn = NULL;
endp->cs = NULL;
endp->flags = CS_EP_NONE;
}
@@ -248,7 +248,7 @@
struct connection *conn = ctx;
cs->endp->target = target;
- cs->endp->ctx = ctx;
+ cs->endp->conn = ctx;
cs->endp->flags |= CS_EP_T_MUX;
cs->endp->flags &= ~CS_EP_DETACHED;
if (!conn->ctx)
@@ -381,7 +381,7 @@
if (cs->endp) {
/* the cs is the only one one the endpoint */
cs->endp->target = NULL;
- cs->endp->ctx = NULL;
+ cs->endp->conn = NULL;
cs->endp->flags &= CS_EP_APP_MASK;
cs->endp->flags |= CS_EP_DETACHED;
}
diff --git a/src/mux_h1.c b/src/mux_h1.c
index c5f0b03..14e399f 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -822,7 +822,7 @@
if (!h1s->endp)
goto fail;
h1s->endp->target = h1s;
- h1s->endp->ctx = h1c->conn;
+ h1s->endp->conn = h1c->conn;
h1s->endp->flags |= (CS_EP_T_MUX|CS_EP_ORPHAN);
}
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 9ed2727..cd57d98 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -1613,7 +1613,7 @@
if (!h2s->endp)
goto out_close;
h2s->endp->target = h2s;
- h2s->endp->ctx = h2c->conn;
+ h2s->endp->conn = h2c->conn;
h2s->endp->flags |= (CS_EP_T_MUX|CS_EP_ORPHAN|CS_EP_NOT_FIRST);
/* FIXME wrong analogy between ext-connect and websocket, this need to
diff --git a/src/mux_pt.c b/src/mux_pt.c
index 821f558..338e4fe 100644
--- a/src/mux_pt.c
+++ b/src/mux_pt.c
@@ -299,7 +299,7 @@
goto fail_free_ctx;
}
ctx->endp->target = ctx;
- ctx->endp->ctx = conn;
+ ctx->endp->conn = conn;
ctx->endp->flags |= (CS_EP_T_MUX|CS_EP_ORPHAN);
cs = cs_new_from_endp(ctx->endp, sess, input);
@@ -419,7 +419,7 @@
*/
static void mux_pt_detach(struct cs_endpoint *endp)
{
- struct connection *conn = endp->ctx;
+ struct connection *conn = endp->conn;
struct mux_pt_ctx *ctx;
TRACE_ENTER(PT_EV_STRM_END, conn, endp->cs);