CLEANUP: conn_stream: rename cs_endpoint to sedesc (stream endpoint descriptor)
After some discussion we found that the cs_endpoint was precisely the
descriptor for a stream endpoint, hence the naturally coming name,
stream endpoint constructor.
This patch renames only the type everywhere and the new/init/free functions
to remain consistent with it. Future patches will address field names and
argument names in various code areas.
diff --git a/src/mux_h2.c b/src/mux_h2.c
index ffa54d2..1b4c16f 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -212,7 +212,7 @@
* it is being processed in the internal HTTP representation (HTX).
*/
struct h2s {
- struct cs_endpoint *endp;
+ struct sedesc *endp;
struct session *sess;
struct h2c *h2c;
struct eb32_node by_id; /* place in h2c's streams_by_id */
@@ -523,14 +523,14 @@
static int h2_settings_max_frame_size = 0; /* unset */
/* a dummy closed endpoint */
-static const struct cs_endpoint closed_ep = {
+static const struct sedesc closed_ep = {
. cs = NULL,
.flags = SE_FL_DETACHED,
};
/* a dmumy closed stream */
static const struct h2s *h2_closed_stream = &(const struct h2s){
- .endp = (struct cs_endpoint *)&closed_ep,
+ .endp = (struct sedesc *)&closed_ep,
.h2c = NULL,
.st = H2_SS_CLOSED,
.errcode = H2_ERR_STREAM_CLOSED,
@@ -540,7 +540,7 @@
/* a dmumy closed stream returning a PROTOCOL_ERROR error */
static const struct h2s *h2_error_stream = &(const struct h2s){
- .endp = (struct cs_endpoint *)&closed_ep,
+ .endp = (struct sedesc *)&closed_ep,
.h2c = NULL,
.st = H2_SS_CLOSED,
.errcode = H2_ERR_PROTOCOL_ERROR,
@@ -550,7 +550,7 @@
/* a dmumy closed stream returning a REFUSED_STREAM error */
static const struct h2s *h2_refused_stream = &(const struct h2s){
- .endp = (struct cs_endpoint *)&closed_ep,
+ .endp = (struct sedesc *)&closed_ep,
.h2c = NULL,
.st = H2_SS_CLOSED,
.errcode = H2_ERR_REFUSED_STREAM,
@@ -560,7 +560,7 @@
/* and a dummy idle stream for use with any unannounced stream */
static const struct h2s *h2_idle_stream = &(const struct h2s){
- .endp = (struct cs_endpoint *)&closed_ep,
+ .endp = (struct sedesc *)&closed_ep,
.h2c = NULL,
.st = H2_SS_IDLE,
.errcode = H2_ERR_STREAM_CLOSED,
@@ -1525,7 +1525,7 @@
/* ditto, calling tasklet_free() here should be ok */
tasklet_free(h2s->shut_tl);
BUG_ON(h2s->endp && !se_fl_test(h2s->endp, SE_FL_ORPHAN));
- cs_endpoint_free(h2s->endp);
+ sedesc_free(h2s->endp);
pool_free(pool_head_h2s, h2s);
TRACE_LEAVE(H2_EV_H2S_END, conn);
@@ -1609,7 +1609,7 @@
if (!h2s)
goto out_alloc;
- h2s->endp = cs_endpoint_new();
+ h2s->endp = sedesc_new();
if (!h2s->endp)
goto out_close;
h2s->endp->se = h2s;
@@ -4289,7 +4289,7 @@
* Attach a new stream to a connection
* (Used for outgoing connections)
*/
-static int h2_attach(struct connection *conn, struct cs_endpoint *endp, struct session *sess)
+static int h2_attach(struct connection *conn, struct sedesc *endp, struct session *sess)
{
struct h2s *h2s;
struct h2c *h2c = conn->ctx;
@@ -4368,7 +4368,7 @@
/*
* Detach the stream from the connection and possibly release the connection.
*/
-static void h2_detach(struct cs_endpoint *endp)
+static void h2_detach(struct sedesc *endp)
{
struct h2s *h2s = endp->se;
struct h2c *h2c;