mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
CLEANUP: stdesc: rename the stream connector ->cs field to ->sc
This is a rename of this field. Most of the places were in muxes, but were already factored with the previous series adding *_sc().
This commit is contained in:
parent
32c095b622
commit
c105492bf5
@ -115,7 +115,7 @@ static inline void appctx_wakeup(struct appctx *appctx)
|
|||||||
/* returns the stream connector the appctx is attached to, via the sedesc */
|
/* returns the stream connector the appctx is attached to, via the sedesc */
|
||||||
static inline struct stconn *appctx_cs(const struct appctx *appctx)
|
static inline struct stconn *appctx_cs(const struct appctx *appctx)
|
||||||
{
|
{
|
||||||
return appctx->sedesc->cs;
|
return appctx->sedesc->sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns the stream the appctx is attached to. Note that a stream *must*
|
/* returns the stream the appctx is attached to. Note that a stream *must*
|
||||||
@ -123,7 +123,7 @@ static inline struct stconn *appctx_cs(const struct appctx *appctx)
|
|||||||
*/
|
*/
|
||||||
static inline struct stream *appctx_strm(const struct appctx *appctx)
|
static inline struct stream *appctx_strm(const struct appctx *appctx)
|
||||||
{
|
{
|
||||||
return __cs_strm(appctx->sedesc->cs);
|
return __cs_strm(appctx->sedesc->sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* _HAPROXY_APPLET_H */
|
#endif /* _HAPROXY_APPLET_H */
|
||||||
|
@ -163,13 +163,13 @@ struct data_cb {
|
|||||||
*
|
*
|
||||||
* <se> is the stream endpoint, i.e. the mux stream or the appctx
|
* <se> is the stream endpoint, i.e. the mux stream or the appctx
|
||||||
* <conn> is the connection for connection-based streams
|
* <conn> is the connection for connection-based streams
|
||||||
* <cs> is the stream connector we're attached to, or NULL
|
* <sc> is the stream connector we're attached to, or NULL
|
||||||
* <flags> SE_FL_*
|
* <flags> SE_FL_*
|
||||||
*/
|
*/
|
||||||
struct sedesc {
|
struct sedesc {
|
||||||
void *se;
|
void *se;
|
||||||
struct connection *conn;
|
struct connection *conn;
|
||||||
struct stconn *cs;
|
struct stconn *sc;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ static inline struct stconn *qc_attach_cs(struct qcs *qcs, struct buffer *buf)
|
|||||||
sess->t_handshake = 0;
|
sess->t_handshake = 0;
|
||||||
sess->t_idle = 0;
|
sess->t_idle = 0;
|
||||||
|
|
||||||
return qcs->endp->cs;
|
return qcs->endp->sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* USE_QUIC */
|
#endif /* USE_QUIC */
|
||||||
|
@ -86,7 +86,7 @@ void sedesc_init(struct sedesc *sedesc)
|
|||||||
{
|
{
|
||||||
sedesc->se = NULL;
|
sedesc->se = NULL;
|
||||||
sedesc->conn = NULL;
|
sedesc->conn = NULL;
|
||||||
sedesc->cs = NULL;
|
sedesc->sc = NULL;
|
||||||
se_fl_setall(sedesc, SE_FL_NONE);
|
se_fl_setall(sedesc, SE_FL_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ static struct stconn *cs_new(struct sedesc *sedesc)
|
|||||||
goto alloc_error;
|
goto alloc_error;
|
||||||
}
|
}
|
||||||
cs->sedesc = sedesc;
|
cs->sedesc = sedesc;
|
||||||
sedesc->cs = cs;
|
sedesc->sc = cs;
|
||||||
|
|
||||||
return cs;
|
return cs;
|
||||||
|
|
||||||
@ -354,7 +354,7 @@ static void cs_detach_endp(struct stconn **csp)
|
|||||||
if (cs->wait_event.events != 0)
|
if (cs->wait_event.events != 0)
|
||||||
conn->mux->unsubscribe(cs, cs->wait_event.events, &cs->wait_event);
|
conn->mux->unsubscribe(cs, cs->wait_event.events, &cs->wait_event);
|
||||||
se_fl_set(sedesc, SE_FL_ORPHAN);
|
se_fl_set(sedesc, SE_FL_ORPHAN);
|
||||||
sedesc->cs = NULL;
|
sedesc->sc = NULL;
|
||||||
cs->sedesc = NULL;
|
cs->sedesc = NULL;
|
||||||
conn->mux->detach(sedesc);
|
conn->mux->detach(sedesc);
|
||||||
}
|
}
|
||||||
@ -373,7 +373,7 @@ static void cs_detach_endp(struct stconn **csp)
|
|||||||
struct appctx *appctx = __cs_appctx(cs);
|
struct appctx *appctx = __cs_appctx(cs);
|
||||||
|
|
||||||
sc_ep_set(cs, SE_FL_ORPHAN);
|
sc_ep_set(cs, SE_FL_ORPHAN);
|
||||||
cs->sedesc->cs = NULL;
|
cs->sedesc->sc = NULL;
|
||||||
cs->sedesc = NULL;
|
cs->sedesc = NULL;
|
||||||
appctx_shut(appctx);
|
appctx_shut(appctx);
|
||||||
appctx_free(appctx);
|
appctx_free(appctx);
|
||||||
@ -467,7 +467,7 @@ int cs_reset_endp(struct stconn *cs)
|
|||||||
cs_detach_endp(&cs);
|
cs_detach_endp(&cs);
|
||||||
BUG_ON(cs->sedesc);
|
BUG_ON(cs->sedesc);
|
||||||
cs->sedesc = new_endp;
|
cs->sedesc = new_endp;
|
||||||
cs->sedesc->cs = cs;
|
cs->sedesc->sc = cs;
|
||||||
sc_ep_set(cs, SE_FL_DETACHED);
|
sc_ep_set(cs, SE_FL_DETACHED);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -372,7 +372,7 @@ static int fcgi_strm_send_abort(struct fcgi_conn *fconn, struct fcgi_strm *fstrm
|
|||||||
|
|
||||||
/* a dummy closed endpoint */
|
/* a dummy closed endpoint */
|
||||||
static const struct sedesc closed_ep = {
|
static const struct sedesc closed_ep = {
|
||||||
. cs = NULL,
|
.sc = NULL,
|
||||||
.flags = SE_FL_DETACHED,
|
.flags = SE_FL_DETACHED,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -425,7 +425,7 @@ static inline const char *fstrm_st_to_str(enum fcgi_strm_st st)
|
|||||||
/* returns the stconn associated to the FCGI stream */
|
/* returns the stconn associated to the FCGI stream */
|
||||||
static forceinline struct stconn *fcgi_strm_sc(const struct fcgi_strm *fstrm)
|
static forceinline struct stconn *fcgi_strm_sc(const struct fcgi_strm *fstrm)
|
||||||
{
|
{
|
||||||
return fstrm->endp->cs;
|
return fstrm->endp->sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3533,7 +3533,7 @@ static int fcgi_attach(struct connection *conn, struct sedesc *endp, struct sess
|
|||||||
struct fcgi_conn *fconn = conn->ctx;
|
struct fcgi_conn *fconn = conn->ctx;
|
||||||
|
|
||||||
TRACE_ENTER(FCGI_EV_FSTRM_NEW, conn);
|
TRACE_ENTER(FCGI_EV_FSTRM_NEW, conn);
|
||||||
fstrm = fcgi_stconn_new(fconn, endp->cs, sess);
|
fstrm = fcgi_stconn_new(fconn, endp->sc, sess);
|
||||||
if (!fstrm)
|
if (!fstrm)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
@ -367,7 +367,7 @@ static void h1_wake_stream_for_send(struct h1s *h1s);
|
|||||||
/* returns the stconn associated to the H1 stream */
|
/* returns the stconn associated to the H1 stream */
|
||||||
static forceinline struct stconn *h1s_sc(const struct h1s *h1s)
|
static forceinline struct stconn *h1s_sc(const struct h1s *h1s)
|
||||||
{
|
{
|
||||||
return h1s->endp->cs;
|
return h1s->endp->sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the H1 traces always expect that arg1, if non-null, is of type connection
|
/* the H1 traces always expect that arg1, if non-null, is of type connection
|
||||||
@ -3320,7 +3320,7 @@ static int h1_attach(struct connection *conn, struct sedesc *endp, struct sessio
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1s = h1c_bck_stream_new(h1c, endp->cs, sess);
|
h1s = h1c_bck_stream_new(h1c, endp->sc, sess);
|
||||||
if (h1s == NULL) {
|
if (h1s == NULL) {
|
||||||
TRACE_ERROR("h1s creation failure", H1_EV_STRM_NEW|H1_EV_STRM_END|H1_EV_STRM_ERR, conn);
|
TRACE_ERROR("h1s creation failure", H1_EV_STRM_NEW|H1_EV_STRM_END|H1_EV_STRM_ERR, conn);
|
||||||
goto err;
|
goto err;
|
||||||
|
@ -524,7 +524,7 @@ static int h2_settings_max_frame_size = 0; /* unset */
|
|||||||
|
|
||||||
/* a dummy closed endpoint */
|
/* a dummy closed endpoint */
|
||||||
static const struct sedesc closed_ep = {
|
static const struct sedesc closed_ep = {
|
||||||
. cs = NULL,
|
.sc = NULL,
|
||||||
.flags = SE_FL_DETACHED,
|
.flags = SE_FL_DETACHED,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -615,7 +615,7 @@ static inline const char *h2s_st_to_str(enum h2_ss st)
|
|||||||
/* returns the stconn associated to the H2 stream */
|
/* returns the stconn associated to the H2 stream */
|
||||||
static forceinline struct stconn *h2s_sc(const struct h2s *h2s)
|
static forceinline struct stconn *h2s_sc(const struct h2s *h2s)
|
||||||
{
|
{
|
||||||
return h2s->endp->cs;
|
return h2s->endp->sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* the H2 traces always expect that arg1, if non-null, is of type connection
|
/* the H2 traces always expect that arg1, if non-null, is of type connection
|
||||||
@ -4301,7 +4301,7 @@ static int h2_attach(struct connection *conn, struct sedesc *endp, struct sessio
|
|||||||
struct h2c *h2c = conn->ctx;
|
struct h2c *h2c = conn->ctx;
|
||||||
|
|
||||||
TRACE_ENTER(H2_EV_H2S_NEW, conn);
|
TRACE_ENTER(H2_EV_H2S_NEW, conn);
|
||||||
h2s = h2c_bck_stream_new(h2c, endp->cs, sess);
|
h2s = h2c_bck_stream_new(h2c, endp->sc, sess);
|
||||||
if (!h2s) {
|
if (!h2s) {
|
||||||
TRACE_DEVEL("leaving on stream creation failure", H2_EV_H2S_NEW|H2_EV_H2S_ERR, conn);
|
TRACE_DEVEL("leaving on stream creation failure", H2_EV_H2S_NEW|H2_EV_H2S_ERR, conn);
|
||||||
return -1;
|
return -1;
|
||||||
|
10
src/mux_pt.c
10
src/mux_pt.c
@ -94,7 +94,7 @@ INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE);
|
|||||||
/* returns the stconn associated to the stream */
|
/* returns the stconn associated to the stream */
|
||||||
static forceinline struct stconn *pt_sc(const struct mux_pt_ctx *pt)
|
static forceinline struct stconn *pt_sc(const struct mux_pt_ctx *pt)
|
||||||
{
|
{
|
||||||
return pt->endp->cs;
|
return pt->endp->sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void pt_trace_buf(const struct buffer *buf, size_t ofs, size_t len)
|
static inline void pt_trace_buf(const struct buffer *buf, size_t ofs, size_t len)
|
||||||
@ -386,12 +386,12 @@ static int mux_pt_attach(struct connection *conn, struct sedesc *endp, struct se
|
|||||||
TRACE_ENTER(PT_EV_STRM_NEW, conn);
|
TRACE_ENTER(PT_EV_STRM_NEW, conn);
|
||||||
if (ctx->wait_event.events)
|
if (ctx->wait_event.events)
|
||||||
conn->xprt->unsubscribe(ctx->conn, conn->xprt_ctx, SUB_RETRY_RECV, &ctx->wait_event);
|
conn->xprt->unsubscribe(ctx->conn, conn->xprt_ctx, SUB_RETRY_RECV, &ctx->wait_event);
|
||||||
if (cs_attach_mux(endp->cs, ctx, conn) < 0)
|
if (cs_attach_mux(endp->sc, ctx, conn) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
ctx->endp = endp;
|
ctx->endp = endp;
|
||||||
se_fl_set(ctx->endp, SE_FL_RCV_MORE);
|
se_fl_set(ctx->endp, SE_FL_RCV_MORE);
|
||||||
|
|
||||||
TRACE_LEAVE(PT_EV_STRM_NEW, conn, endp->cs);
|
TRACE_LEAVE(PT_EV_STRM_NEW, conn, endp->sc);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -428,7 +428,7 @@ static void mux_pt_detach(struct sedesc *endp)
|
|||||||
struct connection *conn = endp->conn;
|
struct connection *conn = endp->conn;
|
||||||
struct mux_pt_ctx *ctx;
|
struct mux_pt_ctx *ctx;
|
||||||
|
|
||||||
TRACE_ENTER(PT_EV_STRM_END, conn, endp->cs);
|
TRACE_ENTER(PT_EV_STRM_END, conn, endp->sc);
|
||||||
|
|
||||||
ctx = conn->ctx;
|
ctx = conn->ctx;
|
||||||
|
|
||||||
@ -438,7 +438,7 @@ static void mux_pt_detach(struct sedesc *endp)
|
|||||||
conn->xprt->subscribe(conn, conn->xprt_ctx, SUB_RETRY_RECV, &ctx->wait_event);
|
conn->xprt->subscribe(conn, conn->xprt_ctx, SUB_RETRY_RECV, &ctx->wait_event);
|
||||||
} else {
|
} else {
|
||||||
/* There's no session attached to that connection, destroy it */
|
/* There's no session attached to that connection, destroy it */
|
||||||
TRACE_DEVEL("killing dead connection", PT_EV_STRM_END, conn, endp->cs);
|
TRACE_DEVEL("killing dead connection", PT_EV_STRM_END, conn, endp->sc);
|
||||||
mux_pt_destroy(ctx);
|
mux_pt_destroy(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1582,7 +1582,7 @@ static int qc_wake_some_streams(struct qcc *qcc)
|
|||||||
node = eb64_next(node)) {
|
node = eb64_next(node)) {
|
||||||
qcs = eb64_entry(node, struct qcs, by_id);
|
qcs = eb64_entry(node, struct qcs, by_id);
|
||||||
|
|
||||||
if (!qcs->endp || !qcs->endp->cs)
|
if (!qcs->endp || !qcs->endp->sc)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (qcc->conn->flags & CO_FL_ERROR) {
|
if (qcc->conn->flags & CO_FL_ERROR) {
|
||||||
@ -1594,8 +1594,8 @@ static int qc_wake_some_streams(struct qcc *qcc)
|
|||||||
qcs_notify_recv(qcs);
|
qcs_notify_recv(qcs);
|
||||||
qcs_notify_send(qcs);
|
qcs_notify_send(qcs);
|
||||||
}
|
}
|
||||||
else if (qcs->endp->cs->data_cb->wake) {
|
else if (qcs->endp->sc->data_cb->wake) {
|
||||||
qcs->endp->cs->data_cb->wake(qcs->endp->cs);
|
qcs->endp->sc->data_cb->wake(qcs->endp->sc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user