From: Willy Tarreau Date: Tue, 17 May 2022 15:53:22 +0000 (+0200) Subject: CLEANUP: conn_stream: rename cs_endpoint to sedesc (stream endpoint descriptor) X-Git-Tag: v2.6-dev12~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea59b0201cd1690d2a1b114f2bdbf94af55c1d84;p=thirdparty%2Fhaproxy.git 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/include/haproxy/applet-t.h b/include/haproxy/applet-t.h index 8e7eddb8cd..ca0e2c2b77 100644 --- a/include/haproxy/applet-t.h +++ b/include/haproxy/applet-t.h @@ -38,7 +38,7 @@ struct appctx; struct proxy; struct conn_stream; -struct cs_endpoint; +struct sedesc; struct session; /* Applet descriptor */ @@ -63,7 +63,7 @@ struct appctx { struct buffer *chunk; /* used to store unfinished commands */ struct applet *applet; /* applet this context refers to */ struct session *sess; /* session for frontend applets (NULL for backend applets) */ - struct cs_endpoint *endp; + struct sedesc *endp; struct act_rule *rule; /* rule associated with the applet. */ int (*io_handler)(struct appctx *appctx); /* used within the cli_io_handler when st0 = CLI_ST_CALLBACK */ void (*io_release)(struct appctx *appctx); /* used within the cli_io_handler when st0 = CLI_ST_CALLBACK, diff --git a/include/haproxy/applet.h b/include/haproxy/applet.h index 0fb508ce21..7cc97426da 100644 --- a/include/haproxy/applet.h +++ b/include/haproxy/applet.h @@ -40,21 +40,21 @@ int appctx_buf_available(void *arg); void *applet_reserve_svcctx(struct appctx *appctx, size_t size); void appctx_shut(struct appctx *appctx); -struct appctx *appctx_new(struct applet *applet, struct cs_endpoint *endp, unsigned long thread_mask); +struct appctx *appctx_new(struct applet *applet, struct sedesc *endp, unsigned long thread_mask); int appctx_finalize_startup(struct appctx *appctx, struct proxy *px, struct buffer *input); void appctx_free_on_early_error(struct appctx *appctx); -static inline struct appctx *appctx_new_on(struct applet *applet, struct cs_endpoint *endp, uint thr) +static inline struct appctx *appctx_new_on(struct applet *applet, struct sedesc *endp, uint thr) { return appctx_new(applet, endp, 1UL << thr); } -static inline struct appctx *appctx_new_here(struct applet *applet, struct cs_endpoint *endp) +static inline struct appctx *appctx_new_here(struct applet *applet, struct sedesc *endp) { return appctx_new(applet, endp, tid_bit); } -static inline struct appctx *appctx_new_anywhere(struct applet *applet, struct cs_endpoint *endp) +static inline struct appctx *appctx_new_anywhere(struct applet *applet, struct sedesc *endp) { return appctx_new(applet, endp, MAX_THREADS_MASK); } @@ -85,7 +85,7 @@ static inline void __appctx_free(struct appctx *appctx) if (appctx->sess) session_free(appctx->sess); BUG_ON(appctx->endp && !se_fl_test(appctx->endp, SE_FL_ORPHAN)); - cs_endpoint_free(appctx->endp); + sedesc_free(appctx->endp); pool_free(pool_head_appctx, appctx); _HA_ATOMIC_DEC(&nb_applets); } diff --git a/include/haproxy/conn_stream-t.h b/include/haproxy/conn_stream-t.h index 88964f6923..3e072aed3c 100644 --- a/include/haproxy/conn_stream-t.h +++ b/include/haproxy/conn_stream-t.h @@ -149,20 +149,24 @@ struct data_cb { }; -/* cs_endpoint is the link between the conn-stream and the endpoint (mux or - * appctx). It is created by the mux/applet on the client side and share with - * the conn-stream. On the server side, it is the opposite. A cs-endpoint - * without conn-stream is called an orphan endpoint. A cs-endpoint with no - * mux/applet is called a detached endpoint. On detach, the conn-stream - * transfers the whole responsibility to the mux/applet and eventually create a - * new cs-endpoint (for instance on connection retries). +/* A Stream Endpoint Descriptor (sedesc) is the link between the stream + * connector (ex. conn_stream) and the Stream Endpoint (mux or appctx). + * It always exists for either of them, and binds them together. It also + * contains some shared information relative to the endpoint. It is created by + * the first one which needs it and is shared by the other one, i.e. on the + * client side, it's created the mux or applet and shared with the connector. + * An sedesc without stconn is called an ORPHANED descriptor. An sedesc with + * no mux/applet is called a DETACHED descriptor. Upon detach, the connector + * transfers the whole responsibility of the endpoint descriptor to the + * endpoint itself (mux/applet) and eventually creates a new sedesc (for + * instance on connection retries). * * is the stream endpoint, i.e. the mux stream or the appctx * is the connection for connection-based streams * is the conn_stream we're attached to, or NULL * SE_FL_* */ -struct cs_endpoint { +struct sedesc { void *se; struct connection *conn; struct conn_stream *cs; @@ -188,7 +192,7 @@ struct conn_stream { unsigned int flags; /* CS_FL_* */ unsigned int hcto; /* half-closed timeout (0 = unset) */ struct wait_event wait_event; /* We're in a wait list */ - struct cs_endpoint *endp; /* points to the end point (MUX stream or appctx) */ + struct sedesc *endp; /* points to the end point (MUX stream or appctx) */ enum obj_type *app; /* points to the applicative point (stream or check) */ const struct data_cb *data_cb; /* data layer callbacks. Must be set before xprt->init() */ struct cs_app_ops *ops; /* general operations used at the app layer */ diff --git a/include/haproxy/conn_stream.h b/include/haproxy/conn_stream.h index b27bb824c6..8db8f68ac2 100644 --- a/include/haproxy/conn_stream.h +++ b/include/haproxy/conn_stream.h @@ -35,10 +35,10 @@ struct check; #define IS_HTX_CS(cs) (cs_conn(cs) && IS_HTX_CONN(__cs_conn(cs))) -struct cs_endpoint *cs_endpoint_new(); -void cs_endpoint_free(struct cs_endpoint *endp); +struct sedesc *sedesc_new(); +void sedesc_free(struct sedesc *sedesc); -struct conn_stream *cs_new_from_endp(struct cs_endpoint *endp, struct session *sess, struct buffer *input); +struct conn_stream *cs_new_from_endp(struct sedesc *sedesc, struct session *sess, struct buffer *input); struct conn_stream *cs_new_from_strm(struct stream *strm, unsigned int flags); struct conn_stream *cs_new_from_check(struct check *check, unsigned int flags); void cs_free(struct conn_stream *cs); @@ -62,32 +62,32 @@ struct appctx *cs_applet_create(struct conn_stream *cs, struct applet *app); */ /* stream endpoint version */ -static forceinline void se_fl_zero(struct cs_endpoint *se) +static forceinline void se_fl_zero(struct sedesc *se) { se->flags = 0; } -static forceinline void se_fl_setall(struct cs_endpoint *se, uint all) +static forceinline void se_fl_setall(struct sedesc *se, uint all) { se->flags = all; } -static forceinline void se_fl_set(struct cs_endpoint *se, uint on) +static forceinline void se_fl_set(struct sedesc *se, uint on) { se->flags |= on; } -static forceinline void se_fl_clr(struct cs_endpoint *se, uint off) +static forceinline void se_fl_clr(struct sedesc *se, uint off) { se->flags &= ~off; } -static forceinline uint se_fl_test(const struct cs_endpoint *se, uint test) +static forceinline uint se_fl_test(const struct sedesc *se, uint test) { return !!(se->flags & test); } -static forceinline uint se_fl_get(const struct cs_endpoint *se) +static forceinline uint se_fl_get(const struct sedesc *se) { return se->flags; } @@ -271,7 +271,7 @@ static inline void cs_conn_drain_and_shut(struct conn_stream *cs) } /* sets SE_FL_ERROR or SE_FL_ERR_PENDING on the endpoint */ -static inline void cs_ep_set_error(struct cs_endpoint *endp) +static inline void cs_ep_set_error(struct sedesc *endp) { if (se_fl_test(endp, SE_FL_EOS)) se_fl_set(endp, SE_FL_ERROR); diff --git a/include/haproxy/connection-t.h b/include/haproxy/connection-t.h index 77b43b8421..5e537b0d1c 100644 --- a/include/haproxy/connection-t.h +++ b/include/haproxy/connection-t.h @@ -41,7 +41,7 @@ /* referenced below */ struct connection; struct conn_stream; -struct cs_endpoint; +struct sedesc; struct cs_info; struct buffer; struct proxy; @@ -396,9 +396,9 @@ struct mux_ops { void (*shutr)(struct conn_stream *cs, enum co_shr_mode); /* shutr function */ void (*shutw)(struct conn_stream *cs, enum co_shw_mode); /* shutw function */ - int (*attach)(struct connection *conn, struct cs_endpoint *, struct session *sess); /* attach a conn_stream to an outgoing connection */ + int (*attach)(struct connection *conn, struct sedesc *, struct session *sess); /* attach a conn_stream to an outgoing connection */ struct conn_stream *(*get_first_cs)(const struct connection *); /* retrieves any valid conn_stream from this connection */ - void (*detach)(struct cs_endpoint *); /* Detach a conn_stream from an outgoing connection, when the request is done */ + void (*detach)(struct sedesc *); /* Detach a conn_stream from an outgoing connection, when the request is done */ int (*show_fd)(struct buffer *, struct connection *); /* append some data about connection into chunk for "show fd"; returns non-zero if suspicious */ int (*subscribe)(struct conn_stream *cs, int event_type, struct wait_event *es); /* Subscribe to events, such as "being able to send" */ int (*unsubscribe)(struct conn_stream *cs, int event_type, struct wait_event *es); /* Unsubscribe from events */ diff --git a/include/haproxy/mux_quic-t.h b/include/haproxy/mux_quic-t.h index 40f784c319..25fd0dd9fd 100644 --- a/include/haproxy/mux_quic-t.h +++ b/include/haproxy/mux_quic-t.h @@ -104,7 +104,7 @@ struct qcc { struct qcs { struct qcc *qcc; - struct cs_endpoint *endp; + struct sedesc *endp; uint32_t flags; /* QC_SF_* */ void *ctx; /* app-ops context */ diff --git a/include/haproxy/mux_quic.h b/include/haproxy/mux_quic.h index 31055e10c5..e9b97adf45 100644 --- a/include/haproxy/mux_quic.h +++ b/include/haproxy/mux_quic.h @@ -96,7 +96,7 @@ static inline struct conn_stream *qc_attach_cs(struct qcs *qcs, struct buffer *b struct qcc *qcc = qcs->qcc; struct session *sess = qcc->conn->owner; - qcs->endp = cs_endpoint_new(); + qcs->endp = sedesc_new(); if (!qcs->endp) return NULL; diff --git a/src/applet.c b/src/applet.c index db493f3c38..b4c9bef32d 100644 --- a/src/applet.c +++ b/src/applet.c @@ -31,7 +31,7 @@ DECLARE_POOL(pool_head_appctx, "appctx", sizeof(struct appctx)); * appctx_free(). is assigned as the applet, but it can be NULL. The * applet's task is always created on the current thread. */ -struct appctx *appctx_new(struct applet *applet, struct cs_endpoint *endp, unsigned long thread_mask) +struct appctx *appctx_new(struct applet *applet, struct sedesc *endp, unsigned long thread_mask) { struct appctx *appctx; @@ -47,7 +47,7 @@ struct appctx *appctx_new(struct applet *applet, struct cs_endpoint *endp, unsig appctx->applet = applet; appctx->sess = NULL; if (!endp) { - endp = cs_endpoint_new(); + endp = sedesc_new(); if (!endp) goto fail_endp; endp->se = appctx; @@ -69,7 +69,7 @@ struct appctx *appctx_new(struct applet *applet, struct cs_endpoint *endp, unsig return appctx; fail_task: - cs_endpoint_free(appctx->endp); + sedesc_free(appctx->endp); fail_endp: pool_free(pool_head_appctx, appctx); fail_appctx: diff --git a/src/conn_stream.c b/src/conn_stream.c index a99841a10f..da81d27a9e 100644 --- a/src/conn_stream.c +++ b/src/conn_stream.c @@ -21,7 +21,7 @@ #include DECLARE_POOL(pool_head_connstream, "conn_stream", sizeof(struct conn_stream)); -DECLARE_POOL(pool_head_cs_endpoint, "cs_endpoint", sizeof(struct cs_endpoint)); +DECLARE_POOL(pool_head_sedesc, "sedesc", sizeof(struct sedesc)); /* functions used by default on a detached conn-stream */ static void cs_app_shutr(struct conn_stream *cs); @@ -82,33 +82,33 @@ struct data_cb cs_data_applet_cb = { /* Initializes an endpoint */ -void cs_endpoint_init(struct cs_endpoint *endp) +void sedesc_init(struct sedesc *sedesc) { - endp->se = NULL; - endp->conn = NULL; - endp->cs = NULL; - se_fl_setall(endp, SE_FL_NONE); + sedesc->se = NULL; + sedesc->conn = NULL; + sedesc->cs = NULL; + se_fl_setall(sedesc, SE_FL_NONE); } /* Tries to alloc an endpoint and initialize it. Returns NULL on failure. */ -struct cs_endpoint *cs_endpoint_new() +struct sedesc *sedesc_new() { - struct cs_endpoint *endp; + struct sedesc *sedesc; - endp = pool_alloc(pool_head_cs_endpoint); - if (unlikely(!endp)) + sedesc = pool_alloc(pool_head_sedesc); + if (unlikely(!sedesc)) return NULL; - cs_endpoint_init(endp); - return endp; + sedesc_init(sedesc); + return sedesc; } /* Releases an endpoint. It is the caller responsibility to be sure it is safe * and it is not shared with another entity */ -void cs_endpoint_free(struct cs_endpoint *endp) +void sedesc_free(struct sedesc *sedesc) { - pool_free(pool_head_cs_endpoint, endp); + pool_free(pool_head_sedesc, sedesc); } /* Tries to allocate a new conn_stream and initialize its main fields. On @@ -116,7 +116,7 @@ void cs_endpoint_free(struct cs_endpoint *endp) * function. The caller must, at least, set the SE_FL_ORPHAN or SE_FL_DETACHED * flag. */ -static struct conn_stream *cs_new(struct cs_endpoint *endp) +static struct conn_stream *cs_new(struct sedesc *sedesc) { struct conn_stream *cs; @@ -137,13 +137,13 @@ static struct conn_stream *cs_new(struct cs_endpoint *endp) cs->wait_event.events = 0; /* If there is no endpoint, allocate a new one now */ - if (!endp) { - endp = cs_endpoint_new(); - if (unlikely(!endp)) + if (!sedesc) { + sedesc = sedesc_new(); + if (unlikely(!sedesc)) goto alloc_error; } - cs->endp = endp; - endp->cs = cs; + cs->endp = sedesc; + sedesc->cs = cs; return cs; @@ -156,18 +156,18 @@ static struct conn_stream *cs_new(struct cs_endpoint *endp) * defined. It returns NULL on error. On success, the new conn-stream is * returned. In this case, SE_FL_ORPHAN flag is removed. */ -struct conn_stream *cs_new_from_endp(struct cs_endpoint *endp, struct session *sess, struct buffer *input) +struct conn_stream *cs_new_from_endp(struct sedesc *sedesc, struct session *sess, struct buffer *input) { struct conn_stream *cs; - cs = cs_new(endp); + cs = cs_new(sedesc); if (unlikely(!cs)) return NULL; if (unlikely(!stream_new(sess, cs, input))) { pool_free(pool_head_connstream, cs); cs = NULL; } - se_fl_clr(endp, SE_FL_ORPHAN); + se_fl_clr(sedesc, SE_FL_ORPHAN); return cs; } @@ -217,7 +217,7 @@ void cs_free(struct conn_stream *cs) sockaddr_free(&cs->dst); if (cs->endp) { BUG_ON(!sc_ep_test(cs, SE_FL_DETACHED)); - cs_endpoint_free(cs->endp); + sedesc_free(cs->endp); } if (cs->wait_event.tasklet) tasklet_free(cs->wait_event.tasklet); @@ -347,7 +347,7 @@ static void cs_detach_endp(struct conn_stream **csp) if (sc_ep_test(cs, SE_FL_T_MUX)) { struct connection *conn = __cs_conn(cs); - struct cs_endpoint *endp = cs->endp; + struct sedesc *endp = cs->endp; if (conn->mux) { if (cs->wait_event.events != 0) @@ -438,7 +438,7 @@ void cs_destroy(struct conn_stream *cs) */ int cs_reset_endp(struct conn_stream *cs) { - struct cs_endpoint *new_endp; + struct sedesc *new_endp; BUG_ON(!cs->app); @@ -455,7 +455,7 @@ int cs_reset_endp(struct conn_stream *cs) /* allocate the new endpoint first to be able to set error if it * fails */ - new_endp = cs_endpoint_new(); + new_endp = sedesc_new(); if (!unlikely(new_endp)) { sc_ep_set(cs, SE_FL_ERROR); return -1; diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index 2c4e4aa995..62d4a615d1 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -154,7 +154,7 @@ enum fcgi_strm_st { /* FCGI stream descriptor */ struct fcgi_strm { - struct cs_endpoint *endp; + struct sedesc *endp; struct session *sess; struct fcgi_conn *fconn; @@ -371,14 +371,14 @@ static void fcgi_strm_alert(struct fcgi_strm *fstrm); static int fcgi_strm_send_abort(struct fcgi_conn *fconn, struct fcgi_strm *fstrm); /* 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 management stream */ static const struct fcgi_strm *fcgi_mgmt_stream = &(const struct fcgi_strm){ - .endp = (struct cs_endpoint*)&closed_ep, + .endp = (struct sedesc*)&closed_ep, .fconn = NULL, .state = FCGI_SS_CLOSED, .flags = FCGI_SF_NONE, @@ -387,7 +387,7 @@ static const struct fcgi_strm *fcgi_mgmt_stream = &(const struct fcgi_strm){ /* and a dummy idle stream for use with any unknown stream */ static const struct fcgi_strm *fcgi_unknown_stream = &(const struct fcgi_strm){ - .endp = (struct cs_endpoint*)&closed_ep, + .endp = (struct sedesc*)&closed_ep, .fconn = NULL, .state = FCGI_SS_IDLE, .flags = FCGI_SF_NONE, @@ -1040,7 +1040,7 @@ static void fcgi_strm_destroy(struct fcgi_strm *fstrm) LIST_DEL_INIT(&fstrm->send_list); tasklet_free(fstrm->shut_tl); BUG_ON(fstrm->endp && !se_fl_test(fstrm->endp, SE_FL_ORPHAN)); - cs_endpoint_free(fstrm->endp); + sedesc_free(fstrm->endp); pool_free(pool_head_fcgi_strm, fstrm); TRACE_LEAVE(FCGI_EV_FSTRM_END, conn); @@ -3521,7 +3521,7 @@ static size_t fcgi_strm_parse_response(struct fcgi_strm *fstrm, struct buffer *b * Attach a new stream to a connection * (Used for outgoing connections) */ -static int fcgi_attach(struct connection *conn, struct cs_endpoint *endp, struct session *sess) +static int fcgi_attach(struct connection *conn, struct sedesc *endp, struct session *sess) { struct fcgi_strm *fstrm; struct fcgi_conn *fconn = conn->ctx; @@ -3581,7 +3581,7 @@ static void fcgi_destroy(void *ctx) /* * Detach the stream from the connection and possibly release the connection. */ -static void fcgi_detach(struct cs_endpoint *endp) +static void fcgi_detach(struct sedesc *endp) { struct fcgi_strm *fstrm = endp->se; struct fcgi_conn *fconn; diff --git a/src/mux_h1.c b/src/mux_h1.c index e6ef886249..f4a62e39b4 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -118,7 +118,7 @@ struct h1c { /* H1 stream descriptor */ struct h1s { struct h1c *h1c; - struct cs_endpoint *endp; + struct sedesc *endp; uint32_t flags; /* Connection flags: H1S_F_* */ struct wait_event *subs; /* Address of the wait_event the conn_stream associated is waiting on */ @@ -818,7 +818,7 @@ static struct h1s *h1c_frt_stream_new(struct h1c *h1c, struct conn_stream *cs, s h1s->endp = cs->endp; } else { - h1s->endp = cs_endpoint_new(); + h1s->endp = sedesc_new(); if (!h1s->endp) goto fail; h1s->endp->se = h1s; @@ -912,7 +912,7 @@ static void h1s_destroy(struct h1s *h1s) HA_ATOMIC_DEC(&h1c->px_counters->open_streams); BUG_ON(h1s->endp && !se_fl_test(h1s->endp, SE_FL_ORPHAN)); - cs_endpoint_free(h1s->endp); + sedesc_free(h1s->endp); pool_free(pool_head_h1s, h1s); } } @@ -3303,7 +3303,7 @@ struct task *h1_timeout_task(struct task *t, void *context, unsigned int state) * Attach a new stream to a connection * (Used for outgoing connections) */ -static int h1_attach(struct connection *conn, struct cs_endpoint *endp, struct session *sess) +static int h1_attach(struct connection *conn, struct sedesc *endp, struct session *sess) { struct h1c *h1c = conn->ctx; struct h1s *h1s; @@ -3357,7 +3357,7 @@ static void h1_destroy(void *ctx) /* * Detach the stream from the connection and possibly release the connection. */ -static void h1_detach(struct cs_endpoint *endp) +static void h1_detach(struct sedesc *endp) { struct h1s *h1s = endp->se; struct h1c *h1c; diff --git a/src/mux_h2.c b/src/mux_h2.c index ffa54d284f..1b4c16f79f 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -212,7 +212,7 @@ enum h2_ss { * 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 unsigned int h2_settings_max_concurrent_streams = 100; 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 @@ static const struct h2s *h2_closed_stream = &(const struct h2s){ /* 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 @@ static const struct h2s *h2_error_stream = &(const struct h2s){ /* 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 @@ static const struct h2s *h2_refused_stream = &(const struct h2s){ /* 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 @@ static void h2s_destroy(struct h2s *h2s) /* 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 @@ static struct h2s *h2c_frt_stream_new(struct h2c *h2c, int id, struct buffer *in 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 @@ do_leave: * 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 @@ static void h2_destroy(void *ctx) /* * 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; diff --git a/src/mux_pt.c b/src/mux_pt.c index 8750facae9..42dadf9077 100644 --- a/src/mux_pt.c +++ b/src/mux_pt.c @@ -20,7 +20,7 @@ #include struct mux_pt_ctx { - struct cs_endpoint *endp; + struct sedesc *endp; struct connection *conn; struct wait_event wait_event; }; @@ -209,7 +209,7 @@ static void mux_pt_destroy(struct mux_pt_ctx *ctx) conn->xprt->unsubscribe(conn, conn->xprt_ctx, ctx->wait_event.events, &ctx->wait_event); BUG_ON(ctx->endp && !se_fl_test(ctx->endp, SE_FL_ORPHAN)); - cs_endpoint_free(ctx->endp); + sedesc_free(ctx->endp); pool_free(pool_head_pt_ctx, ctx); if (conn) { @@ -293,7 +293,7 @@ static int mux_pt_init(struct connection *conn, struct proxy *prx, struct sessio ctx->conn = conn; if (!cs) { - ctx->endp = cs_endpoint_new(); + ctx->endp = sedesc_new(); if (!ctx->endp) { TRACE_ERROR("CS allocation failure", PT_EV_STRM_NEW|PT_EV_STRM_END|PT_EV_STRM_ERR, conn); goto fail_free_ctx; @@ -323,7 +323,7 @@ static int mux_pt_init(struct connection *conn, struct proxy *prx, struct sessio return 0; fail_free_endp: - cs_endpoint_free(ctx->endp); + sedesc_free(ctx->endp); fail_free_ctx: if (ctx->wait_event.tasklet) tasklet_free(ctx->wait_event.tasklet); @@ -373,7 +373,7 @@ static int mux_pt_wake(struct connection *conn) * Attach a new stream to a connection * (Used for outgoing connections) */ -static int mux_pt_attach(struct connection *conn, struct cs_endpoint *endp, struct session *sess) +static int mux_pt_attach(struct connection *conn, struct sedesc *endp, struct session *sess) { struct mux_pt_ctx *ctx = conn->ctx; @@ -417,7 +417,7 @@ static void mux_pt_destroy_meth(void *ctx) /* * Detach the stream from the connection and possibly release the connection. */ -static void mux_pt_detach(struct cs_endpoint *endp) +static void mux_pt_detach(struct sedesc *endp) { struct connection *conn = endp->conn; struct mux_pt_ctx *ctx; diff --git a/src/mux_quic.c b/src/mux_quic.c index 8e9bda99b1..8abd5358cb 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -214,7 +214,7 @@ void qcs_free(struct qcs *qcs) qc_stream_desc_release(qcs->stream); BUG_ON(qcs->endp && !se_fl_test(qcs->endp, SE_FL_ORPHAN)); - cs_endpoint_free(qcs->endp); + sedesc_free(qcs->endp); eb64_delete(&qcs->by_id); pool_free(pool_head_qcs, qcs); @@ -1422,7 +1422,7 @@ static void qc_destroy(void *ctx) TRACE_LEAVE(QMUX_EV_QCC_END); } -static void qc_detach(struct cs_endpoint *endp) +static void qc_detach(struct sedesc *endp) { struct qcs *qcs = endp->se; struct qcc *qcc = qcs->qcc;