CLEANUP: conn_stream: tree-wide rename to stconn (stream connector)

This renames the "struct conn_stream" to "struct stconn" and updates
the descriptions in all comments (and the rare help descriptions) to
"stream connector" or "connector". This touches a lot of files but
the change is minimal. The local variables were not even renamed, so
there's still a lot of "cs" everywhere.
This commit is contained in:
Willy Tarreau 2022-05-17 19:07:51 +02:00
parent 3a3f480d15
commit 4596fe20d9
60 changed files with 619 additions and 617 deletions

View File

@ -1189,7 +1189,7 @@ static int promex_dump_sticktable_metrics(struct appctx *appctx, struct htx *htx
* Uses <appctx.ctx.stats.px> as a pointer to the current proxy and <sv>/<li>
* as pointers to the current server/listener respectively.
*/
static int promex_dump_metrics(struct appctx *appctx, struct conn_stream *cs, struct htx *htx)
static int promex_dump_metrics(struct appctx *appctx, struct stconn *cs, struct htx *htx)
{
struct promex_ctx *ctx = appctx->svcctx;
int ret;
@ -1353,7 +1353,7 @@ static int promex_dump_metrics(struct appctx *appctx, struct conn_stream *cs, st
/* Parse the query string of request URI to filter the metrics. It returns 1 on
* success and -1 on error. */
static int promex_parse_uri(struct appctx *appctx, struct conn_stream *cs)
static int promex_parse_uri(struct appctx *appctx, struct stconn *cs)
{
struct promex_ctx *ctx = appctx->svcctx;
struct channel *req = cs_oc(cs);
@ -1464,7 +1464,7 @@ static int promex_parse_uri(struct appctx *appctx, struct conn_stream *cs)
/* Send HTTP headers of the response. It returns 1 on success and 0 if <htx> is
* full. */
static int promex_send_headers(struct appctx *appctx, struct conn_stream *cs, struct htx *htx)
static int promex_send_headers(struct appctx *appctx, struct stconn *cs, struct htx *htx)
{
struct channel *chn = cs_ic(cs);
struct htx_sl *sl;
@ -1503,7 +1503,7 @@ static int promex_appctx_init(struct appctx *appctx)
/* The main I/O handler for the promex applet. */
static void promex_appctx_handle_io(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct stream *s = __cs_strm(cs);
struct channel *req = cs_oc(cs);
struct channel *res = cs_ic(cs);

View File

@ -37,7 +37,7 @@
struct appctx;
struct proxy;
struct conn_stream;
struct stconn;
struct sedesc;
struct session;

View File

@ -112,8 +112,8 @@ static inline void appctx_wakeup(struct appctx *appctx)
task_wakeup(appctx->t, TASK_WOKEN_OTHER);
}
/* returns the conn_stream the appctx is attached to, via the sedesc */
static inline struct conn_stream *appctx_cs(const struct appctx *appctx)
/* returns the stream connector the appctx is attached to, via the sedesc */
static inline struct stconn *appctx_cs(const struct appctx *appctx)
{
return appctx->sedesc->cs;
}

View File

@ -32,14 +32,14 @@
* before doing further I/O :
* CF_*_NULL, CF_*_PARTIAL
*
* - pure status flags, reported by conn-stream layer, which must also
* - pure status flags, reported by stream connector layer, which must also
* be cleared before doing further I/O :
* CF_*_TIMEOUT, CF_*_ERROR
*
* - read-only indicators reported by lower data levels :
* CF_STREAMER, CF_STREAMER_FAST
*
* - write-once status flags reported by the conn-stream layer :
* - write-once status flags reported by the stream connector layer :
* CF_SHUTR, CF_SHUTW
*
* - persistent control flags managed only by application level :
@ -48,7 +48,7 @@
* The flags have been arranged for readability, so that the read and write
* bits have the same position in a byte (read being the lower byte and write
* the second one). All flag names are relative to the channel. For instance,
* 'write' indicates the direction from the channel to the conn-stream.
* 'write' indicates the direction from the channel to the stream connector.
*/
#define CF_READ_NULL 0x00000001 /* last read detected on producer side */

View File

@ -32,7 +32,7 @@
#include <haproxy/ticks.h>
#include <haproxy/tools-t.h>
struct conn_stream;
struct stconn;
/* perform minimal intializations, report 0 in case of error, 1 if OK. */
int init_channel();
@ -64,8 +64,8 @@ static inline struct stream *chn_strm(const struct channel *chn)
return LIST_ELEM(chn, struct stream *, req);
}
/* returns a pointer to the conn-stream feeding the channel (producer) */
static inline struct conn_stream *chn_prod(const struct channel *chn)
/* returns a pointer to the stream connector feeding the channel (producer) */
static inline struct stconn *chn_prod(const struct channel *chn)
{
if (chn->flags & CF_ISRESP)
return LIST_ELEM(chn, struct stream *, res)->csb;
@ -73,8 +73,8 @@ static inline struct conn_stream *chn_prod(const struct channel *chn)
return LIST_ELEM(chn, struct stream *, req)->csf;
}
/* returns a pointer to the conn-stream consuming the channel (producer) */
static inline struct conn_stream *chn_cons(const struct channel *chn)
/* returns a pointer to the stream connector consuming the channel (producer) */
static inline struct stconn *chn_cons(const struct channel *chn)
{
if (chn->flags & CF_ISRESP)
return LIST_ELEM(chn, struct stream *, res)->csf;
@ -477,7 +477,7 @@ static inline int channel_htx_may_recv(const struct channel *chn, const struct h
* are considered as available since they're supposed to leave the buffer. The
* test is optimized to avoid as many operations as possible for the fast case
* and to be used as an "if" condition. Just like channel_recv_limit(), we
* never allow to overwrite the reserve until the output conn-stream is
* never allow to overwrite the reserve until the output stream connector is
* connected, otherwise we could spin on a POST with http-send-name-header.
*/
static inline int channel_may_recv(const struct channel *chn)

View File

@ -150,7 +150,7 @@ struct check {
struct session *sess; /* Health check session. */
struct vars vars; /* Health check dynamic variables. */
struct xprt_ops *xprt; /* transport layer operations for health checks */
struct conn_stream *cs; /* conn_stream state for health checks */
struct stconn *cs; /* stream connector used by health checks */
struct buffer bi, bo; /* input and output buffers to send/recv check */
struct buffer_wait buf_wait; /* Wait list for buffer allocation */
struct task *task; /* the task associated to the health check processing, NULL if disabled */

View File

@ -1,6 +1,6 @@
/*
* include/haproxy/conn_stream-t.h
* This file describes the conn-stream struct and associated constants.
* This file describes the stream connector struct and associated constants.
*
* Copyright 2021 Christopher Faulet <cfaulet@haproxy.com>
*
@ -36,9 +36,9 @@ enum se_flags {
/* unused: 0x00000004 .. 0x00000008 */
/* Endpoint states: none == attached to a mux with a conn-stream */
/* Endpoint states: none == attached to a mux with a stream connector */
SE_FL_DETACHED = 0x00000010, /* The endpoint is detached (no mux/no applet) */
SE_FL_ORPHAN = 0x00000020, /* The endpoint is orphan (no conn-stream) */
SE_FL_ORPHAN = 0x00000020, /* The endpoint is orphan (no stream connector) */
/* unused: 0x00000040 .. 0x00000080 */
@ -55,7 +55,7 @@ enum se_flags {
*/
/* Permanent flags */
SE_FL_NOT_FIRST = 0x00001000, /* This conn-stream is not the first one for the endpoint */
SE_FL_NOT_FIRST = 0x00001000, /* This stream connector is not the first one for the endpoint */
SE_FL_WEBSOCKET = 0x00002000, /* The endpoint uses the websocket proto */
SE_FL_EOI = 0x00004000, /* end-of-input reached */
SE_FL_EOS = 0x00008000, /* End of stream delivered to data layer */
@ -84,7 +84,7 @@ enum se_flags {
SE_FL_APP_MASK = 0x7fe00000, /* Mask for flags set by the app layer */
};
/* conn_stream flags */
/* stconn flags */
enum {
CS_FL_NONE = 0x00000000, /* Just for initialization purposes */
CS_FL_ISBACK = 0x00000001, /* Set for CS on back-side */
@ -134,7 +134,7 @@ enum cs_state_bit {
CS_SB_ALL = CS_SB_INI|CS_SB_REQ|CS_SB_QUE|CS_SB_TAR|CS_SB_ASS|CS_SB_CON|CS_SB_CER|CS_SB_RDY|CS_SB_EST|CS_SB_DIS|CS_SB_CLO,
};
struct conn_stream;
struct stconn;
/* cs_data_cb describes the data layer's recv and send callbacks which are called
* when I/O activity was detected after the transport layer is ready. These
@ -144,7 +144,7 @@ struct conn_stream;
* data movement. It may abort a connection by returning < 0.
*/
struct data_cb {
int (*wake)(struct conn_stream *cs); /* data-layer callback to report activity */
int (*wake)(struct stconn *sc); /* data-layer callback to report activity */
char name[8]; /* data layer name, zero-terminated */
};
@ -163,28 +163,28 @@ struct data_cb {
*
* <se> is the stream endpoint, i.e. the mux stream or the appctx
* <conn> is the connection for connection-based streams
* <cs> is the conn_stream we're attached to, or NULL
* <cs> is the stream connector we're attached to, or NULL
* <flags> SE_FL_*
*/
struct sedesc {
void *se;
struct connection *conn;
struct conn_stream *cs;
struct stconn *cs;
unsigned int flags;
};
/* operations available on a stream connector */
struct sc_app_ops {
void (*chk_rcv)(struct conn_stream *); /* chk_rcv function, may not be null */
void (*chk_snd)(struct conn_stream *); /* chk_snd function, may not be null */
void (*shutr)(struct conn_stream *); /* shut read function, may not be null */
void (*shutw)(struct conn_stream *); /* shut write function, may not be null */
void (*chk_rcv)(struct stconn *); /* chk_rcv function, may not be null */
void (*chk_snd)(struct stconn *); /* chk_snd function, may not be null */
void (*shutr)(struct stconn *); /* shut read function, may not be null */
void (*shutw)(struct stconn *); /* shut write function, may not be null */
};
/*
* This structure describes the elements of a connection relevant to a stream
*/
struct conn_stream {
struct stconn {
enum obj_type obj_type; /* differentiates connection from applet context */
enum cs_state state; /* CS_ST* */
/* 2 bytes hole here */

View File

@ -1,6 +1,6 @@
/*
* include/haproxy/conn_stream.h
* This file contains conn-stream function prototypes
* This file contains stream connector function prototypes
*
* Copyright 2021 Christopher Faulet <cfaulet@haproxy.com>
*
@ -38,18 +38,18 @@ struct check;
struct sedesc *sedesc_new();
void sedesc_free(struct sedesc *sedesc);
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);
struct stconn *cs_new_from_endp(struct sedesc *sedesc, struct session *sess, struct buffer *input);
struct stconn *cs_new_from_strm(struct stream *strm, unsigned int flags);
struct stconn *cs_new_from_check(struct check *check, unsigned int flags);
void cs_free(struct stconn *cs);
int cs_attach_mux(struct conn_stream *cs, void *target, void *ctx);
int cs_attach_strm(struct conn_stream *cs, struct stream *strm);
int cs_attach_mux(struct stconn *cs, void *target, void *ctx);
int cs_attach_strm(struct stconn *cs, struct stream *strm);
void cs_destroy(struct conn_stream *cs);
int cs_reset_endp(struct conn_stream *cs);
void cs_destroy(struct stconn *cs);
int cs_reset_endp(struct stconn *cs);
struct appctx *cs_applet_create(struct conn_stream *cs, struct applet *app);
struct appctx *cs_applet_create(struct stconn *cs, struct applet *app);
/* The se_fl_*() set of functions manipulate the stream endpoint flags from
* the stream endpoint itself. The sc_ep_*() set of functions manipulate the
@ -93,39 +93,39 @@ static forceinline uint se_fl_get(const struct sedesc *se)
}
/* stream connector version */
static forceinline void sc_ep_zero(struct conn_stream *sc)
static forceinline void sc_ep_zero(struct stconn *sc)
{
se_fl_zero(sc->sedesc);
}
static forceinline void sc_ep_setall(struct conn_stream *sc, uint all)
static forceinline void sc_ep_setall(struct stconn *sc, uint all)
{
se_fl_setall(sc->sedesc, all);
}
static forceinline void sc_ep_set(struct conn_stream *sc, uint on)
static forceinline void sc_ep_set(struct stconn *sc, uint on)
{
se_fl_set(sc->sedesc, on);
}
static forceinline void sc_ep_clr(struct conn_stream *sc, uint off)
static forceinline void sc_ep_clr(struct stconn *sc, uint off)
{
se_fl_clr(sc->sedesc, off);
}
static forceinline uint sc_ep_test(const struct conn_stream *sc, uint test)
static forceinline uint sc_ep_test(const struct stconn *sc, uint test)
{
return se_fl_test(sc->sedesc, test);
}
static forceinline uint sc_ep_get(const struct conn_stream *sc)
static forceinline uint sc_ep_get(const struct stconn *sc)
{
return se_fl_get(sc->sedesc);
}
/* Returns the endpoint target without any control */
static inline void *__cs_endp_target(const struct conn_stream *cs)
static inline void *__cs_endp_target(const struct stconn *cs)
{
return cs->sedesc->se;
}
@ -134,11 +134,11 @@ static inline void *__cs_endp_target(const struct conn_stream *cs)
* NULL is returned. __cs_conn() returns the connection without any control
* while cs_conn() check the endpoint type.
*/
static inline struct connection *__cs_conn(const struct conn_stream *cs)
static inline struct connection *__cs_conn(const struct stconn *cs)
{
return cs->sedesc->conn;
}
static inline struct connection *cs_conn(const struct conn_stream *cs)
static inline struct connection *cs_conn(const struct stconn *cs)
{
if (sc_ep_test(cs, SE_FL_T_MUX))
return __cs_conn(cs);
@ -148,7 +148,7 @@ static inline struct connection *cs_conn(const struct conn_stream *cs)
/* Returns the mux ops of the connection from a cs if the endpoint is a
* mux stream. Otherwise NULL is returned.
*/
static inline const struct mux_ops *cs_conn_mux(const struct conn_stream *cs)
static inline const struct mux_ops *cs_conn_mux(const struct stconn *cs)
{
const struct connection *conn = cs_conn(cs);
@ -159,11 +159,11 @@ static inline const struct mux_ops *cs_conn_mux(const struct conn_stream *cs)
* NULL is returned. __cs_mux() returns the mux without any control
* while cs_mux() check the endpoint type.
*/
static inline void *__cs_mux(const struct conn_stream *cs)
static inline void *__cs_mux(const struct stconn *cs)
{
return __cs_endp_target(cs);
}
static inline struct appctx *cs_mux(const struct conn_stream *cs)
static inline struct appctx *cs_mux(const struct stconn *cs)
{
if (sc_ep_test(cs, SE_FL_T_MUX))
return __cs_mux(cs);
@ -174,11 +174,11 @@ static inline struct appctx *cs_mux(const struct conn_stream *cs)
* NULL is returned. __cs_appctx() returns the appctx without any control
* while cs_appctx() check the endpoint type.
*/
static inline struct appctx *__cs_appctx(const struct conn_stream *cs)
static inline struct appctx *__cs_appctx(const struct stconn *cs)
{
return __cs_endp_target(cs);
}
static inline struct appctx *cs_appctx(const struct conn_stream *cs)
static inline struct appctx *cs_appctx(const struct stconn *cs)
{
if (sc_ep_test(cs, SE_FL_T_APPLET))
return __cs_appctx(cs);
@ -189,12 +189,12 @@ static inline struct appctx *cs_appctx(const struct conn_stream *cs)
* NULL is returned. __cs_strm() returns the stream without any control
* while cs_strm() check the application type.
*/
static inline struct stream *__cs_strm(const struct conn_stream *cs)
static inline struct stream *__cs_strm(const struct stconn *cs)
{
return __objt_stream(cs->app);
}
static inline struct stream *cs_strm(const struct conn_stream *cs)
static inline struct stream *cs_strm(const struct stconn *cs)
{
if (obj_type(cs->app) == OBJ_TYPE_STREAM)
return __cs_strm(cs);
@ -205,17 +205,17 @@ static inline struct stream *cs_strm(const struct conn_stream *cs)
* healthcheck. Otherwise NULL is returned. __cs_check() returns the healthcheck
* without any control while cs_check() check the application type.
*/
static inline struct check *__cs_check(const struct conn_stream *cs)
static inline struct check *__cs_check(const struct stconn *cs)
{
return __objt_check(cs->app);
}
static inline struct check *cs_check(const struct conn_stream *cs)
static inline struct check *cs_check(const struct stconn *cs)
{
if (obj_type(cs->app) == OBJ_TYPE_CHECK)
return __objt_check(cs->app);
return NULL;
}
static inline const char *cs_get_data_name(const struct conn_stream *cs)
static inline const char *cs_get_data_name(const struct stconn *cs)
{
if (!cs->data_cb)
return "NONE";
@ -223,7 +223,7 @@ static inline const char *cs_get_data_name(const struct conn_stream *cs)
}
/* shut read */
static inline void cs_conn_shutr(struct conn_stream *cs, enum co_shr_mode mode)
static inline void cs_conn_shutr(struct stconn *cs, enum co_shr_mode mode)
{
const struct mux_ops *mux;
@ -240,7 +240,7 @@ static inline void cs_conn_shutr(struct conn_stream *cs, enum co_shr_mode mode)
}
/* shut write */
static inline void cs_conn_shutw(struct conn_stream *cs, enum co_shw_mode mode)
static inline void cs_conn_shutw(struct stconn *cs, enum co_shw_mode mode)
{
const struct mux_ops *mux;
@ -256,15 +256,15 @@ static inline void cs_conn_shutw(struct conn_stream *cs, enum co_shw_mode mode)
sc_ep_set(cs, (mode == CO_SHW_NORMAL) ? SE_FL_SHWN : SE_FL_SHWS);
}
/* completely close a conn_stream (but do not detach it) */
static inline void cs_conn_shut(struct conn_stream *cs)
/* completely close a stream connector (but do not detach it) */
static inline void cs_conn_shut(struct stconn *cs)
{
cs_conn_shutw(cs, CO_SHW_SILENT);
cs_conn_shutr(cs, CO_SHR_RESET);
}
/* completely close a conn_stream after draining possibly pending data (but do not detach it) */
static inline void cs_conn_drain_and_shut(struct conn_stream *cs)
/* completely close a stream connector after draining possibly pending data (but do not detach it) */
static inline void cs_conn_drain_and_shut(struct stconn *cs)
{
cs_conn_shutw(cs, CO_SHW_SILENT);
cs_conn_shutr(cs, CO_SHR_DRAIN);
@ -279,16 +279,16 @@ static inline void cs_ep_set_error(struct sedesc *endp)
se_fl_set(endp, SE_FL_ERR_PENDING);
}
/* Retrieves any valid conn_stream from this connection, preferably the first
/* Retrieves any valid stream connector from this connection, preferably the first
* valid one. The purpose is to be able to figure one other end of a private
* connection for purposes like source binding or proxy protocol header
* emission. In such cases, any conn_stream is expected to be valid so the
* emission. In such cases, any stream connector is expected to be valid so the
* mux is encouraged to return the first one it finds. If the connection has
* no mux or the mux has no get_first_cs() method or the mux has no valid
* conn_stream, NULL is returned. The output pointer is purposely marked
* stream connector, NULL is returned. The output pointer is purposely marked
* const to discourage the caller from modifying anything there.
*/
static inline struct conn_stream *cs_conn_get_first(const struct connection *conn)
static inline struct stconn *cs_conn_get_first(const struct connection *conn)
{
BUG_ON(!conn || !conn->mux);
@ -298,136 +298,136 @@ static inline struct conn_stream *cs_conn_get_first(const struct connection *con
}
/* Returns non-zero if the conn-stream's Rx path is blocked */
static inline int cs_rx_blocked(const struct conn_stream *cs)
/* Returns non-zero if the stream connector's Rx path is blocked */
static inline int cs_rx_blocked(const struct stconn *cs)
{
return !!sc_ep_test(cs, SE_FL_RXBLK_ANY);
}
/* Returns non-zero if the conn-stream's Rx path is blocked because of lack
/* Returns non-zero if the stream connector's Rx path is blocked because of lack
* of room in the input buffer.
*/
static inline int cs_rx_blocked_room(const struct conn_stream *cs)
static inline int cs_rx_blocked_room(const struct stconn *cs)
{
return !!sc_ep_test(cs, SE_FL_RXBLK_ROOM);
}
/* Returns non-zero if the conn-stream's endpoint is ready to receive */
static inline int cs_rx_endp_ready(const struct conn_stream *cs)
/* Returns non-zero if the stream connector's endpoint is ready to receive */
static inline int cs_rx_endp_ready(const struct stconn *cs)
{
return !sc_ep_test(cs, SE_FL_RX_WAIT_EP);
}
/* The conn-stream announces it is ready to try to deliver more data to the input buffer */
static inline void cs_rx_endp_more(struct conn_stream *cs)
/* The stream connector announces it is ready to try to deliver more data to the input buffer */
static inline void cs_rx_endp_more(struct stconn *cs)
{
sc_ep_clr(cs, SE_FL_RX_WAIT_EP);
}
/* The conn-stream announces it doesn't have more data for the input buffer */
static inline void cs_rx_endp_done(struct conn_stream *cs)
/* The stream connector announces it doesn't have more data for the input buffer */
static inline void cs_rx_endp_done(struct stconn *cs)
{
sc_ep_set(cs, SE_FL_RX_WAIT_EP);
}
/* Tell a conn-stream the input channel is OK with it sending it some data */
static inline void cs_rx_chan_rdy(struct conn_stream *cs)
/* Tell a stream connector the input channel is OK with it sending it some data */
static inline void cs_rx_chan_rdy(struct stconn *cs)
{
sc_ep_clr(cs, SE_FL_RXBLK_CHAN);
}
/* Tell a conn-stream the input channel is not OK with it sending it some data */
static inline void cs_rx_chan_blk(struct conn_stream *cs)
/* Tell a stream connector the input channel is not OK with it sending it some data */
static inline void cs_rx_chan_blk(struct stconn *cs)
{
sc_ep_set(cs, SE_FL_RXBLK_CHAN);
}
/* Tell a conn-stream the other side is connected */
static inline void cs_rx_conn_rdy(struct conn_stream *cs)
/* Tell a stream connector the other side is connected */
static inline void cs_rx_conn_rdy(struct stconn *cs)
{
sc_ep_clr(cs, SE_FL_RXBLK_CONN);
}
/* Tell a conn-stream it must wait for the other side to connect */
static inline void cs_rx_conn_blk(struct conn_stream *cs)
/* Tell a stream connector it must wait for the other side to connect */
static inline void cs_rx_conn_blk(struct stconn *cs)
{
sc_ep_set(cs, SE_FL_RXBLK_CONN);
}
/* The conn-stream just got the input buffer it was waiting for */
static inline void cs_rx_buff_rdy(struct conn_stream *cs)
/* The stream connector just got the input buffer it was waiting for */
static inline void cs_rx_buff_rdy(struct stconn *cs)
{
sc_ep_clr(cs, SE_FL_RXBLK_BUFF);
}
/* The conn-stream failed to get an input buffer and is waiting for it.
/* The stream connector failed to get an input buffer and is waiting for it.
* Since it indicates a willingness to deliver data to the buffer that will
* have to be retried, we automatically clear RXBLK_ENDP to be called again
* as soon as RXBLK_BUFF is cleared.
*/
static inline void cs_rx_buff_blk(struct conn_stream *cs)
static inline void cs_rx_buff_blk(struct stconn *cs)
{
sc_ep_set(cs, SE_FL_RXBLK_BUFF);
}
/* Tell a conn-stream some room was made in the input buffer */
static inline void cs_rx_room_rdy(struct conn_stream *cs)
/* Tell a stream connector some room was made in the input buffer */
static inline void cs_rx_room_rdy(struct stconn *cs)
{
sc_ep_clr(cs, SE_FL_RXBLK_ROOM);
}
/* The conn-stream announces it failed to put data into the input buffer
/* The stream connector announces it failed to put data into the input buffer
* by lack of room. Since it indicates a willingness to deliver data to the
* buffer that will have to be retried, we automatically clear RXBLK_ENDP to
* be called again as soon as RXBLK_ROOM is cleared.
*/
static inline void cs_rx_room_blk(struct conn_stream *cs)
static inline void cs_rx_room_blk(struct stconn *cs)
{
sc_ep_set(cs, SE_FL_RXBLK_ROOM);
}
/* The conn-stream announces it will never put new data into the input
/* The stream connector announces it will never put new data into the input
* buffer and that it's not waiting for its endpoint to deliver anything else.
* This function obviously doesn't have a _rdy equivalent.
*/
static inline void cs_rx_shut_blk(struct conn_stream *cs)
static inline void cs_rx_shut_blk(struct stconn *cs)
{
sc_ep_set(cs, SE_FL_RXBLK_SHUT);
}
/* Returns non-zero if the conn-stream's Tx path is blocked */
static inline int cs_tx_blocked(const struct conn_stream *cs)
/* Returns non-zero if the stream connector's Tx path is blocked */
static inline int cs_tx_blocked(const struct stconn *cs)
{
return !!sc_ep_test(cs, SE_FL_WAIT_DATA);
}
/* Returns non-zero if the conn-stream's endpoint is ready to transmit */
static inline int cs_tx_endp_ready(const struct conn_stream *cs)
/* Returns non-zero if the stream connector's endpoint is ready to transmit */
static inline int cs_tx_endp_ready(const struct stconn *cs)
{
return sc_ep_test(cs, SE_FL_WANT_GET);
}
/* Report that a conn-stream wants to get some data from the output buffer */
static inline void cs_want_get(struct conn_stream *cs)
/* Report that a stream connector wants to get some data from the output buffer */
static inline void cs_want_get(struct stconn *cs)
{
sc_ep_set(cs, SE_FL_WANT_GET);
}
/* Report that a conn-stream failed to get some data from the output buffer */
static inline void cs_cant_get(struct conn_stream *cs)
/* Report that a stream connector failed to get some data from the output buffer */
static inline void cs_cant_get(struct stconn *cs)
{
sc_ep_set(cs, SE_FL_WANT_GET | SE_FL_WAIT_DATA);
}
/* Report that a conn-stream doesn't want to get data from the output buffer */
static inline void cs_stop_get(struct conn_stream *cs)
/* Report that a stream connector doesn't want to get data from the output buffer */
static inline void cs_stop_get(struct stconn *cs)
{
sc_ep_clr(cs, SE_FL_WANT_GET);
}
/* Report that a conn-stream won't get any more data from the output buffer */
static inline void cs_done_get(struct conn_stream *cs)
/* Report that a stream connector won't get any more data from the output buffer */
static inline void cs_done_get(struct stconn *cs)
{
sc_ep_clr(cs, SE_FL_WANT_GET | SE_FL_WAIT_DATA);
}

View File

@ -40,7 +40,7 @@
/* referenced below */
struct connection;
struct conn_stream;
struct stconn;
struct sedesc;
struct cs_info;
struct buffer;
@ -389,19 +389,19 @@ struct xprt_ops {
struct mux_ops {
int (*init)(struct connection *conn, struct proxy *prx, struct session *sess, struct buffer *input); /* early initialization */
int (*wake)(struct connection *conn); /* mux-layer callback to report activity, mandatory */
size_t (*rcv_buf)(struct conn_stream *cs, struct buffer *buf, size_t count, int flags); /* Called from the upper layer to get data */
size_t (*snd_buf)(struct conn_stream *cs, struct buffer *buf, size_t count, int flags); /* Called from the upper layer to send data */
int (*rcv_pipe)(struct conn_stream *cs, struct pipe *pipe, unsigned int count); /* recv-to-pipe callback */
int (*snd_pipe)(struct conn_stream *cs, struct pipe *pipe); /* send-to-pipe callback */
void (*shutr)(struct conn_stream *cs, enum co_shr_mode); /* shutr function */
void (*shutw)(struct conn_stream *cs, enum co_shw_mode); /* shutw function */
size_t (*rcv_buf)(struct stconn *cs, struct buffer *buf, size_t count, int flags); /* Called from the upper layer to get data */
size_t (*snd_buf)(struct stconn *cs, struct buffer *buf, size_t count, int flags); /* Called from the upper layer to send data */
int (*rcv_pipe)(struct stconn *cs, struct pipe *pipe, unsigned int count); /* recv-to-pipe callback */
int (*snd_pipe)(struct stconn *cs, struct pipe *pipe); /* send-to-pipe callback */
void (*shutr)(struct stconn *cs, enum co_shr_mode); /* shutr function */
void (*shutw)(struct stconn *cs, enum co_shw_mode); /* shutw function */
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 sedesc *); /* Detach a conn_stream from an outgoing connection, when the request is done */
struct stconn *(*get_first_cs)(const struct connection *); /* retrieves any valid conn_stream from this connection */
void (*detach)(struct sedesc *); /* Detach an stconn from the stdesc 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 <es> to events, such as "being able to send" */
int (*unsubscribe)(struct conn_stream *cs, int event_type, struct wait_event *es); /* Unsubscribe <es> from events */
int (*subscribe)(struct stconn *cs, int event_type, struct wait_event *es); /* Subscribe <es> to events, such as "being able to send" */
int (*unsubscribe)(struct stconn *cs, int event_type, struct wait_event *es); /* Unsubscribe <es> from events */
int (*avail_streams)(struct connection *conn); /* Returns the number of streams still available for a connection */
int (*avail_streams_bidi)(struct connection *conn); /* Returns the number of bidirectional streams still available for a connection */
int (*avail_streams_uni)(struct connection *conn); /* Returns the number of unidirectional streams still available for a connection */

View File

@ -1,6 +1,6 @@
/*
* include/haproxy/cs_utils.h
* This file contains conn-stream util functions prototypes
* This file contains stream connector util functions prototypes
*
* Copyright 2022 Christopher Faulet <cfaulet@haproxy.com>
*
@ -33,51 +33,51 @@
#include <haproxy/session.h>
#include <haproxy/stream.h>
void cs_update_rx(struct conn_stream *cs);
void cs_update_tx(struct conn_stream *cs);
void cs_update_rx(struct stconn *cs);
void cs_update_tx(struct stconn *cs);
struct task *cs_conn_io_cb(struct task *t, void *ctx, unsigned int state);
int cs_conn_sync_recv(struct conn_stream *cs);
void cs_conn_sync_send(struct conn_stream *cs);
int cs_conn_sync_recv(struct stconn *cs);
void cs_conn_sync_send(struct stconn *cs);
/* returns the channel which receives data from this conn-stream (input channel) */
static inline struct channel *cs_ic(struct conn_stream *cs)
/* returns the channel which receives data from this stream connector (input channel) */
static inline struct channel *cs_ic(struct stconn *cs)
{
struct stream *strm = __cs_strm(cs);
return ((cs->flags & CS_FL_ISBACK) ? &(strm->res) : &(strm->req));
}
/* returns the channel which feeds data to this conn-stream (output channel) */
static inline struct channel *cs_oc(struct conn_stream *cs)
/* returns the channel which feeds data to this stream connector (output channel) */
static inline struct channel *cs_oc(struct stconn *cs)
{
struct stream *strm = __cs_strm(cs);
return ((cs->flags & CS_FL_ISBACK) ? &(strm->req) : &(strm->res));
}
/* returns the buffer which receives data from this conn-stream (input channel's buffer) */
static inline struct buffer *cs_ib(struct conn_stream *cs)
/* returns the buffer which receives data from this stream connector (input channel's buffer) */
static inline struct buffer *cs_ib(struct stconn *cs)
{
return &cs_ic(cs)->buf;
}
/* returns the buffer which feeds data to this conn-stream (output channel's buffer) */
static inline struct buffer *cs_ob(struct conn_stream *cs)
/* returns the buffer which feeds data to this stream connector (output channel's buffer) */
static inline struct buffer *cs_ob(struct stconn *cs)
{
return &cs_oc(cs)->buf;
}
/* returns the stream's task associated to this conn-stream */
static inline struct task *cs_strm_task(struct conn_stream *cs)
/* returns the stream's task associated to this stream connector */
static inline struct task *cs_strm_task(struct stconn *cs)
{
struct stream *strm = __cs_strm(cs);
return strm->task;
}
/* returns the conn-stream on the other side. Used during forwarding. */
static inline struct conn_stream *cs_opposite(struct conn_stream *cs)
/* returns the stream connector on the other side. Used during forwarding. */
static inline struct stconn *cs_opposite(struct stconn *cs)
{
struct stream *strm = __cs_strm(cs);
@ -86,7 +86,7 @@ static inline struct conn_stream *cs_opposite(struct conn_stream *cs)
/* to be called only when in CS_ST_DIS with CS_FL_ERR */
static inline void cs_report_error(struct conn_stream *cs)
static inline void cs_report_error(struct stconn *cs)
{
if (!__cs_strm(cs)->conn_err_type)
__cs_strm(cs)->conn_err_type = STRM_ET_DATA_ERR;
@ -95,15 +95,15 @@ static inline void cs_report_error(struct conn_stream *cs)
cs_ic(cs)->flags |= CF_READ_ERROR;
}
/* sets the current and previous state of a conn-stream to <state>. This is
/* sets the current and previous state of a stream connector to <state>. This is
* mainly used to create one in the established state on incoming conncetions.
*/
static inline void cs_set_state(struct conn_stream *cs, int state)
static inline void cs_set_state(struct stconn *cs, int state)
{
cs->state = __cs_strm(cs)->prev_conn_state = state;
}
/* returns a bit for a conn-stream state, to match against CS_SB_* */
/* returns a bit for a stream connector state, to match against CS_SB_* */
static inline enum cs_state_bit cs_state_bit(enum cs_state state)
{
BUG_ON(state > CS_ST_CLO);
@ -117,10 +117,10 @@ static inline int cs_state_in(enum cs_state state, enum cs_state_bit mask)
return !!(cs_state_bit(state) & mask);
}
/* Returns true if a connection is attached to the conn-stream <cs> and if this
/* Returns true if a connection is attached to the stream connector <cs> and if this
* connection is ready.
*/
static inline int cs_conn_ready(struct conn_stream *cs)
static inline int cs_conn_ready(struct stconn *cs)
{
struct connection *conn = cs_conn(cs);
@ -128,13 +128,13 @@ static inline int cs_conn_ready(struct conn_stream *cs)
}
/* The conn-stream is only responsible for the connection during the early
/* The stream connector is only responsible for the connection during the early
* states, before plugging a mux. Thus it should only care about CO_FL_ERROR
* before CS_ST_EST, and after that it must absolutely ignore it since the mux
* may hold pending data. This function returns true if such an error was
* reported. Both the CS and the CONN must be valid.
*/
static inline int cs_is_conn_error(const struct conn_stream *cs)
static inline int cs_is_conn_error(const struct stconn *cs)
{
struct connection *conn;
@ -146,15 +146,15 @@ static inline int cs_is_conn_error(const struct conn_stream *cs)
return !!(conn->flags & CO_FL_ERROR);
}
/* Try to allocate a buffer for the conn-stream's input channel. It relies on
/* Try to allocate a buffer for the stream connector's input channel. It relies on
* channel_alloc_buffer() for this so it abides by its rules. It returns 0 on
* failure, non-zero otherwise. If no buffer is available, the requester,
* represented by the <wait> pointer, will be added in the list of objects
* waiting for an available buffer, and SE_FL_RXBLK_BUFF will be set on the
* conn-stream and SE_FL_RX_WAIT_EP cleared. The requester will be responsible
* stream connector and SE_FL_RX_WAIT_EP cleared. The requester will be responsible
* for calling this function to try again once woken up.
*/
static inline int cs_alloc_ibuf(struct conn_stream *cs, struct buffer_wait *wait)
static inline int cs_alloc_ibuf(struct stconn *cs, struct buffer_wait *wait)
{
int ret;
@ -165,11 +165,11 @@ static inline int cs_alloc_ibuf(struct conn_stream *cs, struct buffer_wait *wait
}
/* Returns the source address of the conn-stream and, if not set, fallbacks on
/* Returns the source address of the stream connector and, if not set, fallbacks on
* the session for frontend CS and the server connection for the backend CS. It
* returns a const address on success or NULL on failure.
*/
static inline const struct sockaddr_storage *cs_src(struct conn_stream *cs)
static inline const struct sockaddr_storage *cs_src(struct stconn *cs)
{
if (cs->src)
return cs->src;
@ -185,11 +185,11 @@ static inline const struct sockaddr_storage *cs_src(struct conn_stream *cs)
}
/* Returns the destination address of the conn-stream and, if not set, fallbacks
/* Returns the destination address of the stream connector and, if not set, fallbacks
* on the session for frontend CS and the server connection for the backend
* CS. It returns a const address on success or NULL on failure.
*/
static inline const struct sockaddr_storage *cs_dst(struct conn_stream *cs)
static inline const struct sockaddr_storage *cs_dst(struct stconn *cs)
{
if (cs->dst)
return cs->dst;
@ -204,13 +204,13 @@ static inline const struct sockaddr_storage *cs_dst(struct conn_stream *cs)
return NULL;
}
/* Retrieves the source address of the conn-stream. Returns non-zero on success
/* Retrieves the source address of the stream connector. Returns non-zero on success
* or zero on failure. The operation is only performed once and the address is
* stored in the conn-stream for future use. On the first call, the conn-stream
* stored in the stream connector for future use. On the first call, the stream connector
* source address is copied from the session one for frontend CS and the server
* connection for the backend CS.
*/
static inline int cs_get_src(struct conn_stream *cs)
static inline int cs_get_src(struct stconn *cs)
{
const struct sockaddr_storage *src = NULL;
@ -234,13 +234,13 @@ static inline int cs_get_src(struct conn_stream *cs)
return 1;
}
/* Retrieves the destination address of the conn-stream. Returns non-zero on
/* Retrieves the destination address of the stream connector. Returns non-zero on
* success or zero on failure. The operation is only performed once and the
* address is stored in the conn-stream for future use. On the first call, the
* conn-stream destination address is copied from the session one for frontend
* address is stored in the stream connector for future use. On the first call, the
* stream connector destination address is copied from the session one for frontend
* CS and the server connection for the backend CS.
*/
static inline int cs_get_dst(struct conn_stream *cs)
static inline int cs_get_dst(struct stconn *cs)
{
const struct sockaddr_storage *dst = NULL;
@ -265,32 +265,32 @@ static inline int cs_get_dst(struct conn_stream *cs)
}
/* Marks on the conn-stream that next shutw must kill the whole connection */
static inline void cs_must_kill_conn(struct conn_stream *cs)
/* Marks on the stream connector that next shutw must kill the whole connection */
static inline void cs_must_kill_conn(struct stconn *cs)
{
sc_ep_set(cs, SE_FL_KILL_CONN);
}
/* Sends a shutr to the endpoint using the data layer */
static inline void cs_shutr(struct conn_stream *cs)
static inline void cs_shutr(struct stconn *cs)
{
cs->ops->shutr(cs);
}
/* Sends a shutw to the endpoint using the data layer */
static inline void cs_shutw(struct conn_stream *cs)
static inline void cs_shutw(struct stconn *cs)
{
cs->ops->shutw(cs);
}
/* This is to be used after making some room available in a channel. It will
* return without doing anything if the conn-stream's RX path is blocked.
* It will automatically mark the conn-stream as busy processing the end
* return without doing anything if the stream connector's RX path is blocked.
* It will automatically mark the stream connector as busy processing the end
* point in order to avoid useless repeated wakeups.
* It will then call ->chk_rcv() to enable receipt of new data.
*/
static inline void cs_chk_rcv(struct conn_stream *cs)
static inline void cs_chk_rcv(struct stconn *cs)
{
if (sc_ep_test(cs, SE_FL_RXBLK_CONN) && cs_state_in(cs_opposite(cs)->state, CS_SB_RDY|CS_SB_EST|CS_SB_DIS|CS_SB_CLO))
cs_rx_conn_rdy(cs);
@ -306,19 +306,19 @@ static inline void cs_chk_rcv(struct conn_stream *cs)
}
/* Calls chk_snd on the endpoint using the data layer */
static inline void cs_chk_snd(struct conn_stream *cs)
static inline void cs_chk_snd(struct stconn *cs)
{
cs->ops->chk_snd(cs);
}
/* Combines both cs_update_rx() and cs_update_tx() at once */
static inline void cs_update(struct conn_stream *cs)
static inline void cs_update(struct stconn *cs)
{
cs_update_rx(cs);
cs_update_tx(cs);
}
/* for debugging, reports the conn-stream state name */
/* for debugging, reports the stream connector state name */
static inline const char *cs_state_str(int state)
{
switch (state) {

View File

@ -101,7 +101,7 @@ enum h3s_t {
extern const struct qcc_app_ops h3_ops;
size_t h3_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags);
size_t h3_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags);
#endif /* USE_QUIC */
#endif /* _HAPROXY_H3_T_H */

View File

@ -50,10 +50,10 @@ int http_res_set_status(unsigned int status, struct ist reason, struct stream *s
void http_check_request_for_cacheability(struct stream *s, struct channel *req);
void http_check_response_for_cacheability(struct stream *s, struct channel *res);
enum rule_result http_wait_for_msg_body(struct stream *s, struct channel *chn, unsigned int time, unsigned int bytes);
void http_perform_server_redirect(struct stream *s, struct conn_stream *cs);
void http_server_error(struct stream *s, struct conn_stream *cs, int err, int finst, struct http_reply *msg);
void http_perform_server_redirect(struct stream *s, struct stconn *cs);
void http_server_error(struct stream *s, struct stconn *cs, int err, int finst, struct http_reply *msg);
void http_reply_and_close(struct stream *s, short status, struct http_reply *msg);
void http_return_srv_error(struct stream *s, struct conn_stream *cs);
void http_return_srv_error(struct stream *s, struct stconn *cs);
struct http_reply *http_error_message(struct stream *s);
int http_reply_to_htx(struct stream *s, struct htx *htx, struct http_reply *reply);
int http_reply_message(struct stream *s, struct http_reply *reply);

View File

@ -32,7 +32,7 @@ enum qcs_type {
struct qcc {
struct connection *conn;
uint64_t nb_cs; /* number of attached conn-streams */
uint64_t nb_cs; /* number of attached stream connectors */
uint32_t flags; /* QC_CF_* */
struct {
@ -138,7 +138,7 @@ struct qcc_app_ops {
int (*init)(struct qcc *qcc);
int (*attach)(struct qcs *qcs);
int (*decode_qcs)(struct qcs *qcs, int fin, void *ctx);
size_t (*snd_buf)(struct conn_stream *cs, struct buffer *buf, size_t count, int flags);
size_t (*snd_buf)(struct stconn *cs, struct buffer *buf, size_t count, int flags);
void (*detach)(struct qcs *qcs);
int (*finalize)(void *ctx);
int (*is_active)(const struct qcc *qcc, void *ctx);

View File

@ -91,7 +91,7 @@ static inline int qcc_install_app_ops(struct qcc *qcc,
return 0;
}
static inline struct conn_stream *qc_attach_cs(struct qcs *qcs, struct buffer *buf)
static inline struct stconn *qc_attach_cs(struct qcs *qcs, struct buffer *buf)
{
struct qcc *qcc = qcs->qcc;
struct session *sess = qcc->conn->owner;

View File

@ -40,7 +40,7 @@ enum obj_type {
OBJ_TYPE_APPCTX, /* object is a struct appctx */
OBJ_TYPE_CONN, /* object is a struct connection */
OBJ_TYPE_SRVRQ, /* object is a struct dns_srvrq */
OBJ_TYPE_CS, /* object is a struct conn_stream */
OBJ_TYPE_CS, /* object is a struct stconn */
OBJ_TYPE_STREAM, /* object is a struct stream */
OBJ_TYPE_CHECK, /* object is a struct check */
OBJ_TYPE_ENTRIES /* last one : number of entries */

View File

@ -125,12 +125,12 @@ static inline struct appctx *objt_appctx(enum obj_type *t)
return __objt_appctx(t);
}
static inline struct conn_stream *__objt_cs(enum obj_type *t)
static inline struct stconn *__objt_cs(enum obj_type *t)
{
return (container_of(t, struct conn_stream, obj_type));
return (container_of(t, struct stconn, obj_type));
}
static inline struct conn_stream *objt_cs(enum obj_type *t)
static inline struct stconn *objt_cs(enum obj_type *t)
{
if (!t || *t != OBJ_TYPE_CS)
return NULL;

View File

@ -26,7 +26,7 @@
struct proxy;
struct server;
struct conn_stream;
struct stconn;
struct act_rule;
struct list;
@ -55,7 +55,7 @@ void resolv_trigger_resolution(struct resolv_requester *requester);
enum act_parse_ret resolv_parse_do_resolve(const char **args, int *orig_arg, struct proxy *px, struct act_rule *rule, char **err);
int check_action_do_resolve(struct act_rule *rule, struct proxy *px, char **err);
int stats_dump_resolvers(struct conn_stream *cs,
int stats_dump_resolvers(struct stconn *cs,
struct field *stats, size_t stats_count,
struct list *stat_modules);
void resolv_stats_clear_counters(int clrall, struct list *stat_modules);

View File

@ -160,7 +160,7 @@ struct stream {
int conn_retries; /* number of connect retries performed */
unsigned int conn_exp; /* wake up time for connect, queue, turn-around, ... */
unsigned int conn_err_type; /* first error detected, one of STRM_ET_* */
enum cs_state prev_conn_state; /* CS_ST*, copy of previous state of the server conn-stream */
enum cs_state prev_conn_state; /* CS_ST*, copy of previous state of the server stream connector */
struct list list; /* position in the thread's streams list */
struct mt_list by_srv; /* position in server stream list */
@ -187,14 +187,14 @@ struct stream {
struct vars vars_txn; /* list of variables for the txn scope. */
struct vars vars_reqres; /* list of variables for the request and resp scope. */
struct conn_stream *csf; /* frontend conn-stream */
struct conn_stream *csb; /* backend conn-stream */
struct stconn *csf; /* frontend stream connector */
struct stconn *csb; /* backend stream connector */
struct strm_logs logs; /* logs for this stream */
void (*do_log)(struct stream *s); /* the function to call in order to log (or NULL) */
void (*srv_error)(struct stream *s, /* the function to call upon unrecoverable server errors (or NULL) */
struct conn_stream *cs);
struct stconn *cs);
int pcli_next_pid; /* next target PID to use for the CLI proxy */
int pcli_flags; /* flags for CLI proxy */

View File

@ -59,9 +59,9 @@ extern struct pool_head *pool_head_uniqueid;
extern struct data_cb sess_conn_cb;
struct stream *stream_new(struct session *sess, struct conn_stream *cs, struct buffer *input);
struct stream *stream_new(struct session *sess, struct stconn *cs, struct buffer *input);
void stream_free(struct stream *s);
int stream_upgrade_from_cs(struct conn_stream *cs, struct buffer *input);
int stream_upgrade_from_cs(struct stconn *cs, struct buffer *input);
int stream_set_http_mode(struct stream *s, const struct mux_proto_list *mux_proto);
/* kill a stream and set the termination flags to <why> (one of SF_ERR_*) */
@ -74,7 +74,7 @@ struct ist stream_generate_unique_id(struct stream *strm, struct list *format);
void stream_process_counters(struct stream *s);
void sess_change_server(struct stream *strm, struct server *newsrv);
struct task *process_stream(struct task *t, void *context, unsigned int state);
void default_srv_error(struct stream *s, struct conn_stream *cs);
void default_srv_error(struct stream *s, struct stconn *cs);
/* Update the stream's backend and server time stats */
void stream_update_time_stats(struct stream *s);

View File

@ -621,7 +621,7 @@ static int cli_io_handler_show_profiling(struct appctx *appctx)
unsigned long long tot_alloc_calls, tot_free_calls;
unsigned long long tot_alloc_bytes, tot_free_bytes;
#endif
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct buffer *name_buffer = get_trash_chunk();
const char *str;
int max_lines;
@ -849,7 +849,7 @@ static int cli_parse_show_profiling(char **args, char *payload, struct appctx *a
static int cli_io_handler_show_tasks(struct appctx *appctx)
{
struct sched_activity tmp_activity[256] __attribute__((aligned(64)));
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct buffer *name_buffer = get_trash_chunk();
struct sched_activity *entry;
const struct tasklet *tl;

View File

@ -78,7 +78,7 @@ struct appctx *appctx_new(struct applet *applet, struct sedesc *sedesc, unsigned
/* Finalize the frontend appctx startup. It must not be called for a backend
* appctx. This function is responsible to create the appctx's session and the
* frontend conn-stream. By transitivity, the stream is also created.
* frontend stream connector. By transitivity, the stream is also created.
*
* It returns 0 on success and -1 on error. In this case, it is the caller
* responsibility to release the appctx. However, the session is released if it
@ -111,7 +111,7 @@ int appctx_finalize_startup(struct appctx *appctx, struct proxy *px, struct buff
*/
void appctx_free_on_early_error(struct appctx *appctx)
{
/* If a frontend apctx is attached to a conn-stream, release the stream
/* If a frontend appctx is attached to a stream connector, release the stream
* instead of the appctx.
*/
if (!se_fl_test(appctx->sedesc, SE_FL_ORPHAN) && !(appctx_cs(appctx)->flags & CS_FL_ISBACK)) {
@ -156,7 +156,7 @@ void appctx_shut(struct appctx *appctx)
/* Callback used to wake up an applet when a buffer is available. The applet
* <appctx> is woken up if an input buffer was requested for the associated
* conn-stream. In this case the buffer is immediately allocated and the
* stream connector. In this case the buffer is immediately allocated and the
* function returns 1. Otherwise it returns 0. Note that this automatically
* covers multiple wake-up attempts by ensuring that the same buffer will not
* be accounted for multiple times.
@ -164,7 +164,7 @@ void appctx_shut(struct appctx *appctx)
int appctx_buf_available(void *arg)
{
struct appctx *appctx = arg;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
/* allocation requested ? */
if (!se_fl_test(appctx->sedesc, SE_FL_RXBLK_BUFF))
@ -190,7 +190,7 @@ int appctx_buf_available(void *arg)
struct task *task_run_applet(struct task *t, void *context, unsigned int state)
{
struct appctx *app = context;
struct conn_stream *cs;
struct stconn *cs;
unsigned int rate;
size_t count;

View File

@ -1326,7 +1326,7 @@ static int do_connect_server(struct stream *s, struct connection *conn)
* - SF_ERR_RESOURCE if a system resource is lacking (eg: fd limits, ports, ...)
* - SF_ERR_INTERNAL for any other purely internal errors
* Additionally, in the case of SF_ERR_RESOURCE, an emergency log will be emitted.
* The server-facing conn-stream is expected to hold a pre-allocated connection.
* The server-facing stream connector is expected to hold a pre-allocated connection.
*/
static int connect_server(struct stream *s)
{
@ -1630,7 +1630,7 @@ skip_reuse:
srv_conn->proxy_netns = cli_conn ? cli_conn->proxy_netns : NULL;
if (!srv_conn->xprt) {
/* set the correct protocol on the output conn-stream */
/* set the correct protocol on the output stream connector */
if (srv) {
if (conn_prepare(srv_conn, protocol_lookup(srv_conn->dst->ss_family, PROTO_TYPE_STREAM, 0), srv->xprt)) {
conn_free(srv_conn);
@ -1820,7 +1820,7 @@ skip_reuse:
s->be->lbprm.server_take_conn(srv);
}
/* Now handle synchronously connected sockets. We know the conn-stream
/* Now handle synchronously connected sockets. We know the stream connector
* is at least in state CS_ST_CON. These ones typically are UNIX
* sockets, socket pairs, andoccasionally TCP connections on the
* loopback on a heavily loaded system.
@ -1961,7 +1961,7 @@ static int back_may_abort_req(struct channel *req, struct stream *s)
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE))));
}
/* Update back conn-stream status for input states CS_ST_ASS, CS_ST_QUE,
/* Update back stream connector status for input states CS_ST_ASS, CS_ST_QUE,
* CS_ST_TAR. Other input states are simply ignored.
* Possible output states are CS_ST_CLO, CS_ST_TAR, CS_ST_ASS, CS_ST_REQ, CS_ST_CON
* and CS_ST_EST. Flags must have previously been updated for timeouts and other
@ -1970,7 +1970,7 @@ static int back_may_abort_req(struct channel *req, struct stream *s)
void back_try_conn_req(struct stream *s)
{
struct server *srv = objt_server(s->target);
struct conn_stream *cs = s->csb;
struct stconn *cs = s->csb;
struct channel *req = &s->req;
DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
@ -2152,7 +2152,7 @@ abort_connection:
return;
}
/* This function initiates a server connection request on a conn-stream
/* This function initiates a server connection request on a stream connector
* already in CS_ST_REQ state. Upon success, the state goes to CS_ST_ASS for
* a real connection to a server, indicating that a server has been assigned,
* or CS_ST_RDY for a successful connection to an applet. It may also return
@ -2160,7 +2160,7 @@ abort_connection:
*/
void back_handle_st_req(struct stream *s)
{
struct conn_stream *cs = s->csb;
struct stconn *cs = s->csb;
if (cs->state != CS_ST_REQ)
return;
@ -2240,7 +2240,7 @@ void back_handle_st_req(struct stream *s)
*/
void back_handle_st_con(struct stream *s)
{
struct conn_stream *cs = s->csb;
struct stconn *cs = s->csb;
struct channel *req = &s->req;
struct channel *rep = &s->res;
@ -2289,7 +2289,7 @@ void back_handle_st_con(struct stream *s)
*/
void back_handle_st_cer(struct stream *s)
{
struct conn_stream *cs = s->csb;
struct stconn *cs = s->csb;
int must_tar = sc_ep_test(cs, SE_FL_ERROR);
DBG_TRACE_ENTER(STRM_EV_STRM_PROC|STRM_EV_CS_ST, s);
@ -2366,7 +2366,7 @@ void back_handle_st_cer(struct stream *s)
* resources as soon as possible and to not catch errors from the lower
* layers in an unexpected state (i.e < ST_CONN).
*
* Note: the conn-stream will be switched to ST_REQ, ST_ASS or
* Note: the stream connector will be switched to ST_REQ, ST_ASS or
* ST_TAR and SE_FL_ERROR and SF_CONN_EXP flags will be unset.
*/
if (cs_reset_endp(cs) < 0) {
@ -2437,7 +2437,7 @@ void back_handle_st_cer(struct stream *s)
*/
void back_handle_st_rdy(struct stream *s)
{
struct conn_stream *cs = s->csb;
struct stconn *cs = s->csb;
struct channel *req = &s->req;
struct channel *rep = &s->res;

View File

@ -1455,7 +1455,7 @@ static void http_cache_io_handler(struct appctx *appctx)
struct cache_appctx *ctx = appctx->svcctx;
struct cache_entry *cache_ptr = ctx->entry;
struct shared_block *first = block_ptr(cache_ptr);
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct channel *req = cs_oc(cs);
struct channel *res = cs_ic(cs);
struct htx *req_htx, *res_htx;
@ -2600,7 +2600,7 @@ static int cli_io_handler_show_cache(struct appctx *appctx)
{
struct show_cache_ctx *ctx = appctx->svcctx;
struct cache* cache = ctx->cache;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
list_for_each_entry_from(cache, &caches, list) {
struct eb32_node *node = NULL;
@ -2690,7 +2690,7 @@ smp_fetch_res_cache_name(const struct arg *args, struct sample *smp,
if (!smp->strm || smp->strm->target != &http_cache_applet.obj_type)
return 0;
/* Get appctx from the conn-stream. */
/* Get appctx from the stream connector. */
appctx = cs_appctx(smp->strm->csb);
if (appctx && appctx->rule) {
cconf = appctx->rule->arg.act.p[0];

View File

@ -260,7 +260,7 @@ int co_getdelim(const struct channel *chn, char *str, int len, const char *delim
return ret;
}
/* Gets one text word out of a channel's buffer from a conn-stream.
/* Gets one text word out of a channel's buffer from a stream connector.
* Return values :
* >0 : number of bytes read. Includes the sep if present before len or end.
* =0 : no sep before end found. <str> is left undefined.
@ -311,7 +311,7 @@ int co_getword(const struct channel *chn, char *str, int len, char sep)
return ret;
}
/* Gets one text line out of a channel's buffer from a conn-stream.
/* Gets one text line out of a channel's buffer from a stream connector.
* Return values :
* >0 : number of bytes read. Includes the \n if present before len or end.
* =0 : no '\n' before end found. <str> is left undefined.
@ -426,7 +426,7 @@ int co_getblk_nc(const struct channel *chn, const char **blk1, size_t *len1, con
return b_getblk_nc(&chn->buf, blk1, len1, blk2, len2, 0, co_data(chn));
}
/* Gets one text line out of a channel's output buffer from a conn-stream.
/* Gets one text line out of a channel's output buffer from a stream connector.
* Return values :
* >0 : number of blocks returned (1 or 2). blk1 is always filled before blk2.
* =0 : not enough data available.
@ -502,7 +502,7 @@ int ci_getblk_nc(const struct channel *chn,
return 1;
}
/* Gets one text line out of a channel's input buffer from a conn-stream.
/* Gets one text line out of a channel's input buffer from a stream connector.
* Return values :
* >0 : number of blocks returned (1 or 2). blk1 is always filled before blk2.
* =0 : not enough data available.

View File

@ -115,7 +115,7 @@ static const struct name_desc check_trace_decoding[] = {
#define CHK_VERB_CLEAN 1
{ .name="clean", .desc="only user-friendly stuff, generally suitable for level \"user\"" },
#define CHK_VERB_MINIMAL 2
{ .name="minimal", .desc="report info on stream and conn-streams" },
{ .name="minimal", .desc="report info on streams and connectors" },
#define CHK_VERB_SIMPLE 3
{ .name="simple", .desc="add info on request and response channels" },
#define CHK_VERB_ADVANCED 4
@ -140,7 +140,7 @@ struct trace_source trace_check = {
INITCALL1(STG_REGISTER, trace_register_source, TRACE_SOURCE);
static int wake_srv_chk(struct conn_stream *cs);
static int wake_srv_chk(struct stconn *cs);
struct data_cb check_conn_cb = {
.wake = wake_srv_chk,
.name = "CHCK",
@ -778,7 +778,7 @@ static int retrieve_errno_from_socket(struct connection *conn)
*/
void chk_report_conn_err(struct check *check, int errno_bck, int expired)
{
struct conn_stream *cs = check->cs;
struct stconn *cs = check->cs;
struct connection *conn = cs_conn(cs);
const char *err_msg;
struct buffer *chk;
@ -1016,7 +1016,7 @@ int httpchk_build_status_header(struct server *s, struct buffer *buf)
* It returns 0 on normal cases, <0 if at least one close() has happened on the
* connection (eg: reconnect). It relies on tcpcheck_main().
*/
static int wake_srv_chk(struct conn_stream *cs)
static int wake_srv_chk(struct stconn *cs)
{
struct connection *conn;
struct check *check = __cs_check(cs);
@ -1070,7 +1070,7 @@ static int wake_srv_chk(struct conn_stream *cs)
/* This function checks if any I/O is wanted, and if so, attempts to do so */
struct task *srv_chk_io_cb(struct task *t, void *ctx, unsigned int state)
{
struct conn_stream *cs = ctx;
struct stconn *cs = ctx;
wake_srv_chk(cs);
return NULL;
@ -1086,7 +1086,7 @@ struct task *process_chk_conn(struct task *t, void *context, unsigned int state)
{
struct check *check = context;
struct proxy *proxy = check->proxy;
struct conn_stream *cs;
struct stconn *cs;
struct connection *conn;
int rv;
int expired = tick_is_expired(t->expire, now_ms);

View File

@ -887,7 +887,7 @@ static int cli_output_msg(struct channel *chn, const char *msg, int severity, in
return ci_putblk(chn, tmp->area, strlen(tmp->area));
}
/* This I/O handler runs as an applet embedded in a conn-stream. It is
/* This I/O handler runs as an applet embedded in a stream connector. It is
* used to processes I/O from/to the stats unix socket. The system relies on a
* state machine handling requests and various responses. We read a request,
* then we process it and send the response, and we possibly display a prompt.
@ -897,7 +897,7 @@ static int cli_output_msg(struct channel *chn, const char *msg, int severity, in
*/
static void cli_io_handler(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct channel *req = cs_oc(cs);
struct channel *res = cs_ic(cs);
struct bind_conf *bind_conf = strm_li(__cs_strm(cs))->bind_conf;
@ -1198,7 +1198,7 @@ static void cli_io_handler(struct appctx *appctx)
cs->state, req->flags, res->flags, ci_data(req), co_data(req), ci_data(res), co_data(res));
}
/* This is called when the conn-stream is closed. For instance, upon an
/* This is called when the stream connector is closed. For instance, upon an
* external abort, we won't call the i/o handler anymore so we may need to
* remove back references to the stream currently being dumped.
*/
@ -1226,7 +1226,7 @@ static void cli_release_handler(struct appctx *appctx)
static int cli_io_handler_show_env(struct appctx *appctx)
{
struct show_env_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
char **var = ctx->var;
if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
@ -1262,7 +1262,7 @@ static int cli_io_handler_show_env(struct appctx *appctx)
*/
static int cli_io_handler_show_fd(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct show_fd_ctx *fdctx = appctx->svcctx;
int fd = fdctx->fd;
int ret = 1;
@ -1462,7 +1462,7 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
*/
static int cli_io_handler_show_activity(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
int thr;
if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
@ -1567,7 +1567,7 @@ static int cli_io_handler_show_cli_sock(struct appctx *appctx)
{
struct show_sock_ctx *ctx = applet_reserve_svcctx(appctx, sizeof(*ctx));
struct bind_conf *bind_conf = ctx->bind_conf;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
if (!global.cli_fe)
goto done;
@ -1976,7 +1976,7 @@ static int _getsocks(char **args, char *payload, struct appctx *appctx, void *pr
char *cmsgbuf = NULL;
unsigned char *tmpbuf = NULL;
struct cmsghdr *cmsg;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct stream *s = __cs_strm(cs);
struct connection *remote = cs_conn(cs_opposite(cs));
struct msghdr msghdr;

View File

@ -1,5 +1,5 @@
/*
* Conn-stream management functions
* stream connector management functions
*
* Copyright 2021 Christopher Faulet <cfaulet@haproxy.com>
*
@ -20,26 +20,26 @@
#include <haproxy/pipe.h>
#include <haproxy/pool.h>
DECLARE_POOL(pool_head_connstream, "conn_stream", sizeof(struct conn_stream));
DECLARE_POOL(pool_head_connstream, "stconn", sizeof(struct stconn));
DECLARE_POOL(pool_head_sedesc, "sedesc", sizeof(struct sedesc));
/* functions used by default on a detached stream connector */
static void sc_app_shutr(struct conn_stream *cs);
static void sc_app_shutw(struct conn_stream *cs);
static void sc_app_chk_rcv(struct conn_stream *cs);
static void sc_app_chk_snd(struct conn_stream *cs);
static void sc_app_shutr(struct stconn *cs);
static void sc_app_shutw(struct stconn *cs);
static void sc_app_chk_rcv(struct stconn *cs);
static void sc_app_chk_snd(struct stconn *cs);
/* functions used on a mux-based stream connector */
static void sc_app_shutr_conn(struct conn_stream *cs);
static void sc_app_shutw_conn(struct conn_stream *cs);
static void sc_app_chk_rcv_conn(struct conn_stream *cs);
static void sc_app_chk_snd_conn(struct conn_stream *cs);
static void sc_app_shutr_conn(struct stconn *cs);
static void sc_app_shutw_conn(struct stconn *cs);
static void sc_app_chk_rcv_conn(struct stconn *cs);
static void sc_app_chk_snd_conn(struct stconn *cs);
/* functions used on an applet-based stream connector */
static void sc_app_shutr_applet(struct conn_stream *cs);
static void sc_app_shutw_applet(struct conn_stream *cs);
static void sc_app_chk_rcv_applet(struct conn_stream *cs);
static void sc_app_chk_snd_applet(struct conn_stream *cs);
static void sc_app_shutr_applet(struct stconn *cs);
static void sc_app_shutw_applet(struct stconn *cs);
static void sc_app_chk_rcv_applet(struct stconn *cs);
static void sc_app_chk_snd_applet(struct stconn *cs);
/* stream connector operations for connections */
struct sc_app_ops sc_app_conn_ops = {
@ -65,10 +65,10 @@ struct sc_app_ops sc_app_applet_ops = {
.shutw = sc_app_shutw_applet,
};
static int cs_conn_process(struct conn_stream *cs);
static int cs_conn_recv(struct conn_stream *cs);
static int cs_conn_send(struct conn_stream *cs);
static int cs_applet_process(struct conn_stream *cs);
static int cs_conn_process(struct stconn *cs);
static int cs_conn_recv(struct stconn *cs);
static int cs_conn_send(struct stconn *cs);
static int cs_applet_process(struct stconn *cs);
struct data_cb cs_data_conn_cb = {
.wake = cs_conn_process,
@ -111,14 +111,14 @@ void sedesc_free(struct sedesc *sedesc)
pool_free(pool_head_sedesc, sedesc);
}
/* Tries to allocate a new conn_stream and initialize its main fields. On
/* Tries to allocate a new stconn and initialize its main fields. On
* failure, nothing is allocated and NULL is returned. It is an internal
* function. The caller must, at least, set the SE_FL_ORPHAN or SE_FL_DETACHED
* flag.
*/
static struct conn_stream *cs_new(struct sedesc *sedesc)
static struct stconn *cs_new(struct sedesc *sedesc)
{
struct conn_stream *cs;
struct stconn *cs;
cs = pool_alloc(pool_head_connstream);
@ -152,13 +152,13 @@ static struct conn_stream *cs_new(struct sedesc *sedesc)
return NULL;
}
/* Creates a new conn-stream and its associated stream from a mux. <endp> must be
* defined. It returns NULL on error. On success, the new conn-stream is
/* Creates a new stream connector and its associated stream from a mux. <endp> must be
* defined. It returns NULL on error. On success, the new stream connector is
* returned. In this case, SE_FL_ORPHAN flag is removed.
*/
struct conn_stream *cs_new_from_endp(struct sedesc *sedesc, struct session *sess, struct buffer *input)
struct stconn *cs_new_from_endp(struct sedesc *sedesc, struct session *sess, struct buffer *input)
{
struct conn_stream *cs;
struct stconn *cs;
cs = cs_new(sedesc);
if (unlikely(!cs))
@ -171,13 +171,13 @@ struct conn_stream *cs_new_from_endp(struct sedesc *sedesc, struct session *sess
return cs;
}
/* Creates a new conn-stream from an stream. There is no endpoint here, thus it
/* Creates a new stream connector from an stream. There is no endpoint here, thus it
* will be created by cs_new(). So the SE_FL_DETACHED flag is set. It returns
* NULL on error. On success, the new conn-stream is returned.
* NULL on error. On success, the new stream connector is returned.
*/
struct conn_stream *cs_new_from_strm(struct stream *strm, unsigned int flags)
struct stconn *cs_new_from_strm(struct stream *strm, unsigned int flags)
{
struct conn_stream *cs;
struct stconn *cs;
cs = cs_new(NULL);
if (unlikely(!cs))
@ -190,13 +190,13 @@ struct conn_stream *cs_new_from_strm(struct stream *strm, unsigned int flags)
return cs;
}
/* Creates a new conn-stream from an health-check. There is no endpoint here,
/* Creates a new stream connector from an health-check. There is no endpoint here,
* thus it will be created by cs_new(). So the SE_FL_DETACHED flag is set. It
* returns NULL on error. On success, the new conn-stream is returned.
* returns NULL on error. On success, the new stream connector is returned.
*/
struct conn_stream *cs_new_from_check(struct check *check, unsigned int flags)
struct stconn *cs_new_from_check(struct check *check, unsigned int flags)
{
struct conn_stream *cs;
struct stconn *cs;
cs = cs_new(NULL);
if (unlikely(!cs))
@ -208,10 +208,10 @@ struct conn_stream *cs_new_from_check(struct check *check, unsigned int flags)
return cs;
}
/* Releases a conn_stream previously allocated by cs_new(), as well as its
/* Releases a stconn previously allocated by cs_new(), as well as its
* endpoint, if it exists. This function is called internally or on error path.
*/
void cs_free(struct conn_stream *cs)
void cs_free(struct stconn *cs)
{
sockaddr_free(&cs->src);
sockaddr_free(&cs->dst);
@ -224,13 +224,13 @@ void cs_free(struct conn_stream *cs)
pool_free(pool_head_connstream, cs);
}
/* Conditionally removes a conn-stream if it is detached and if there is no app
/* Conditionally removes a stream connector if it is detached and if there is no app
* layer defined. Except on error path, this one must be used. if release, the
* pointer on the CS is set to NULL.
*/
static void cs_free_cond(struct conn_stream **csp)
static void cs_free_cond(struct stconn **csp)
{
struct conn_stream *cs = *csp;
struct stconn *cs = *csp;
if (!cs->app && (!cs->sedesc || sc_ep_test(cs, SE_FL_DETACHED))) {
cs_free(cs);
@ -239,11 +239,11 @@ static void cs_free_cond(struct conn_stream **csp)
}
/* Attaches a conn_stream to a mux endpoint and sets the endpoint ctx. Returns
/* Attaches a stconn to a mux endpoint and sets the endpoint ctx. Returns
* -1 on error and 0 on sucess. SE_FL_DETACHED flag is removed. This function is
* called from a mux when it is attached to a stream or a health-check.
*/
int cs_attach_mux(struct conn_stream *cs, void *endp, void *ctx)
int cs_attach_mux(struct stconn *cs, void *endp, void *ctx)
{
struct connection *conn = ctx;
struct sedesc *sedesc = cs->sedesc;
@ -282,12 +282,12 @@ int cs_attach_mux(struct conn_stream *cs, void *endp, void *ctx)
return 0;
}
/* Attaches a conn_stream to an applet endpoint and sets the endpoint
/* Attaches a stconn to an applet endpoint and sets the endpoint
* ctx. Returns -1 on error and 0 on sucess. SE_FL_DETACHED flag is
* removed. This function is called by a stream when a backend applet is
* registered.
*/
static void cs_attach_applet(struct conn_stream *cs, void *endp)
static void cs_attach_applet(struct stconn *cs, void *endp)
{
cs->sedesc->se = endp;
sc_ep_set(cs, SE_FL_T_APPLET);
@ -298,12 +298,12 @@ static void cs_attach_applet(struct conn_stream *cs, void *endp)
}
}
/* Attaches a conn_stream to a app layer and sets the relevant
/* Attaches a stconn to a app layer and sets the relevant
* callbacks. Returns -1 on error and 0 on success. SE_FL_ORPHAN flag is
* removed. This function is called by a stream when it is created to attach it
* on the conn-stream on the client side.
* on the stream connector on the client side.
*/
int cs_attach_strm(struct conn_stream *cs, struct stream *strm)
int cs_attach_strm(struct stconn *cs, struct stream *strm)
{
cs->app = &strm->obj_type;
sc_ep_clr(cs, SE_FL_ORPHAN);
@ -329,16 +329,16 @@ int cs_attach_strm(struct conn_stream *cs, struct stream *strm)
return 0;
}
/* Detaches the conn_stream from the endpoint, if any. For a connecrion, if a
/* Detaches the stconn from the endpoint, if any. For a connecrion, if a
* mux owns the connection ->detach() callback is called. Otherwise, it means
* the conn-stream owns the connection. In this case the connection is closed
* the stream connector owns the connection. In this case the connection is closed
* and released. For an applet, the appctx is released. If still allocated, the
* endpoint is reset and flag as detached. If the app layer is also detached,
* the conn-stream is released.
* the stream connector is released.
*/
static void cs_detach_endp(struct conn_stream **csp)
static void cs_detach_endp(struct stconn **csp)
{
struct conn_stream *cs = *csp;
struct stconn *cs = *csp;
if (!cs)
return;
@ -398,12 +398,12 @@ static void cs_detach_endp(struct conn_stream **csp)
cs_free_cond(csp);
}
/* Detaches the conn_stream from the app layer. If there is no endpoint attached
* to the conn_stream
/* Detaches the stconn from the app layer. If there is no endpoint attached
* to the stconn
*/
static void cs_detach_app(struct conn_stream **csp)
static void cs_detach_app(struct stconn **csp)
{
struct conn_stream *cs = *csp;
struct stconn *cs = *csp;
if (!cs)
return;
@ -420,24 +420,24 @@ static void cs_detach_app(struct conn_stream **csp)
cs_free_cond(csp);
}
/* Destroy the conn_stream. It is detached from its endpoint and its
* application. After this call, the conn_stream must be considered as released.
/* Destroy the stconn. It is detached from its endpoint and its
* application. After this call, the stconn must be considered as released.
*/
void cs_destroy(struct conn_stream *cs)
void cs_destroy(struct stconn *cs)
{
cs_detach_endp(&cs);
cs_detach_app(&cs);
BUG_ON_HOT(cs);
}
/* Resets the conn-stream endpoint. It happens when the app layer want to renew
/* Resets the stream connector endpoint. It happens when the app layer want to renew
* its endpoint. For a connection retry for instance. If a mux or an applet is
* attached, a new endpoint is created. Returns -1 on error and 0 on sucess.
*
* Only SE_FL_ERROR flag is removed on the endpoint. Orther flags are preserved.
* It is the caller responsibility to remove other flags if needed.
*/
int cs_reset_endp(struct conn_stream *cs)
int cs_reset_endp(struct stconn *cs)
{
struct sedesc *new_endp;
@ -473,13 +473,13 @@ int cs_reset_endp(struct conn_stream *cs)
}
/* Create an applet to handle a conn-stream as a new appctx. The CS will
/* Create an applet to handle a stream connector as a new appctx. The CS will
* wake it up every time it is solicited. The appctx must be deleted by the task
* handler using cs_detach_endp(), possibly from within the function itself.
* It also pre-initializes the applet's context and returns it (or NULL in case
* it could not be allocated).
*/
struct appctx *cs_applet_create(struct conn_stream *cs, struct applet *app)
struct appctx *cs_applet_create(struct stconn *cs, struct applet *app)
{
struct appctx *appctx;
@ -498,13 +498,13 @@ struct appctx *cs_applet_create(struct conn_stream *cs, struct applet *app)
}
/*
* This function performs a shutdown-read on a detached conn-stream in a
* This function performs a shutdown-read on a detached stream connector in a
* connected or init state (it does nothing for other states). It either shuts
* the read side or marks itself as closed. The buffer flags are updated to
* reflect the new state. If the conn-stream has CS_FL_NOHALF, we also
* reflect the new state. If the stream connector has CS_FL_NOHALF, we also
* forward the close to the write side. The owner task is woken up if it exists.
*/
static void sc_app_shutr(struct conn_stream *cs)
static void sc_app_shutr(struct stconn *cs)
{
struct channel *ic = cs_ic(cs);
@ -532,13 +532,13 @@ static void sc_app_shutr(struct conn_stream *cs)
}
/*
* This function performs a shutdown-write on a detached conn-stream in a
* This function performs a shutdown-write on a detached stream connector in a
* connected or init state (it does nothing for other states). It either shuts
* the write side or marks itself as closed. The buffer flags are updated to
* reflect the new state. It does also close everything if the CS was marked as
* being in error state. The owner task is woken up if it exists.
*/
static void sc_app_shutw(struct conn_stream *cs)
static void sc_app_shutw(struct stconn *cs)
{
struct channel *ic = cs_ic(cs);
struct channel *oc = cs_oc(cs);
@ -590,7 +590,7 @@ static void sc_app_shutw(struct conn_stream *cs)
}
/* default chk_rcv function for scheduled tasks */
static void sc_app_chk_rcv(struct conn_stream *cs)
static void sc_app_chk_rcv(struct stconn *cs)
{
struct channel *ic = cs_ic(cs);
@ -610,7 +610,7 @@ static void sc_app_chk_rcv(struct conn_stream *cs)
}
/* default chk_snd function for scheduled tasks */
static void sc_app_chk_snd(struct conn_stream *cs)
static void sc_app_chk_snd(struct stconn *cs)
{
struct channel *oc = cs_oc(cs);
@ -646,7 +646,7 @@ static void sc_app_chk_snd(struct conn_stream *cs)
* descriptors are then shutdown or closed accordingly. The function
* automatically disables polling if needed.
*/
static void sc_app_shutr_conn(struct conn_stream *cs)
static void sc_app_shutr_conn(struct stconn *cs)
{
struct channel *ic = cs_ic(cs);
@ -680,7 +680,7 @@ static void sc_app_shutr_conn(struct conn_stream *cs)
* everything if the CS was marked as being in error state. If there is a
* data-layer shutdown, it is called.
*/
static void sc_app_shutw_conn(struct conn_stream *cs)
static void sc_app_shutw_conn(struct stconn *cs)
{
struct channel *ic = cs_ic(cs);
struct channel *oc = cs_oc(cs);
@ -760,7 +760,7 @@ static void sc_app_shutw_conn(struct conn_stream *cs)
* timeouts, so that we can still check them later at wake-up. This function is
* dedicated to connection-based stream connectors.
*/
static void sc_app_chk_rcv_conn(struct conn_stream *cs)
static void sc_app_chk_rcv_conn(struct stconn *cs)
{
BUG_ON(!cs_conn(cs));
@ -775,7 +775,7 @@ static void sc_app_chk_rcv_conn(struct conn_stream *cs)
* for data in the buffer. Note that it intentionally does not update timeouts,
* so that we can still check them later at wake-up.
*/
static void sc_app_chk_snd_conn(struct conn_stream *cs)
static void sc_app_chk_snd_conn(struct stconn *cs)
{
struct channel *oc = cs_oc(cs);
@ -873,7 +873,7 @@ static void sc_app_chk_snd_conn(struct conn_stream *cs)
* we also forward the close to the write side. The owner task is woken up if
* it exists.
*/
static void sc_app_shutr_applet(struct conn_stream *cs)
static void sc_app_shutr_applet(struct stconn *cs)
{
struct channel *ic = cs_ic(cs);
@ -908,7 +908,7 @@ static void sc_app_shutr_applet(struct conn_stream *cs)
* updated to reflect the new state. It does also close everything if the SI
* was marked as being in error state. The owner task is woken up if it exists.
*/
static void sc_app_shutw_applet(struct conn_stream *cs)
static void sc_app_shutw_applet(struct stconn *cs)
{
struct channel *ic = cs_ic(cs);
struct channel *oc = cs_oc(cs);
@ -962,7 +962,7 @@ static void sc_app_shutw_applet(struct conn_stream *cs)
}
/* chk_rcv function for applets */
static void sc_app_chk_rcv_applet(struct conn_stream *cs)
static void sc_app_chk_rcv_applet(struct stconn *cs)
{
struct channel *ic = cs_ic(cs);
@ -979,7 +979,7 @@ static void sc_app_chk_rcv_applet(struct conn_stream *cs)
}
/* chk_snd function for applets */
static void sc_app_chk_snd_applet(struct conn_stream *cs)
static void sc_app_chk_snd_applet(struct stconn *cs)
{
struct channel *oc = cs_oc(cs);
@ -1008,7 +1008,7 @@ static void sc_app_chk_snd_applet(struct conn_stream *cs)
/* This function is designed to be called from within the stream handler to
* update the input channel's expiration timer and the conn-stream's
* update the input channel's expiration timer and the stream connector's
* Rx flags based on the channel's flags. It needs to be called only once
* after the channel's flags have settled down, and before they are cleared,
* though it doesn't harm to call it as often as desired (it just slightly
@ -1016,7 +1016,7 @@ static void sc_app_chk_snd_applet(struct conn_stream *cs)
* handler, as what it does will be used to compute the stream task's
* expiration.
*/
void cs_update_rx(struct conn_stream *cs)
void cs_update_rx(struct stconn *cs)
{
struct channel *ic = cs_ic(cs);
@ -1052,7 +1052,7 @@ void cs_update_rx(struct conn_stream *cs)
}
/* This function is designed to be called from within the stream handler to
* update the output channel's expiration timer and the conn-stream's
* update the output channel's expiration timer and the stream connector's
* Tx flags based on the channel's flags. It needs to be called only once
* after the channel's flags have settled down, and before they are cleared,
* though it doesn't harm to call it as often as desired (it just slightly
@ -1060,7 +1060,7 @@ void cs_update_rx(struct conn_stream *cs)
* handler, as what it does will be used to compute the stream task's
* expiration.
*/
void cs_update_tx(struct conn_stream *cs)
void cs_update_tx(struct stconn *cs)
{
struct channel *oc = cs_oc(cs);
struct channel *ic = cs_ic(cs);
@ -1109,11 +1109,11 @@ void cs_update_tx(struct conn_stream *cs)
* It should not be called from within the stream itself, cs_update()
* is designed for this.
*/
static void cs_notify(struct conn_stream *cs)
static void cs_notify(struct stconn *cs)
{
struct channel *ic = cs_ic(cs);
struct channel *oc = cs_oc(cs);
struct conn_stream *cso = cs_opposite(cs);
struct stconn *cso = cs_opposite(cs);
struct task *task = cs_strm_task(cs);
/* process consumer side */
@ -1235,10 +1235,10 @@ static void cs_notify(struct conn_stream *cs)
/*
* This function propagates a null read received on a socket-based connection.
* It updates the conn-stream. If the conn-stream has CS_FL_NOHALF,
* It updates the stream connector. If the stream connector has CS_FL_NOHALF,
* the close is also forwarded to the write side as an abort.
*/
static void cs_conn_read0(struct conn_stream *cs)
static void cs_conn_read0(struct stconn *cs)
{
struct channel *ic = cs_ic(cs);
struct channel *oc = cs_oc(cs);
@ -1287,7 +1287,7 @@ static void cs_conn_read0(struct conn_stream *cs)
* into the buffer from the connection. It iterates over the mux layer's
* rcv_buf function.
*/
static int cs_conn_recv(struct conn_stream *cs)
static int cs_conn_recv(struct stconn *cs)
{
struct connection *conn = __cs_conn(cs);
struct channel *ic = cs_ic(cs);
@ -1611,20 +1611,20 @@ static int cs_conn_recv(struct conn_stream *cs)
return ret;
}
/* This tries to perform a synchronous receive on the conn-stream to
/* This tries to perform a synchronous receive on the stream connector to
* try to collect last arrived data. In practice it's only implemented on
* conn_streams. Returns 0 if nothing was done, non-zero if new data or a
* stconns. Returns 0 if nothing was done, non-zero if new data or a
* shutdown were collected. This may result on some delayed receive calls
* to be programmed and performed later, though it doesn't provide any
* such guarantee.
*/
int cs_conn_sync_recv(struct conn_stream *cs)
int cs_conn_sync_recv(struct stconn *cs)
{
if (!cs_state_in(cs->state, CS_SB_RDY|CS_SB_EST))
return 0;
if (!cs_conn_mux(cs))
return 0; // only conn_streams are supported
return 0; // only stconns are supported
if (cs->wait_event.events & SUB_RETRY_RECV)
return 0; // already subscribed
@ -1641,7 +1641,7 @@ int cs_conn_sync_recv(struct conn_stream *cs)
* caller to commit polling changes. The caller should check conn->flags
* for errors.
*/
static int cs_conn_send(struct conn_stream *cs)
static int cs_conn_send(struct stconn *cs)
{
struct connection *conn = __cs_conn(cs);
struct stream *s = __cs_strm(cs);
@ -1782,11 +1782,11 @@ static int cs_conn_send(struct conn_stream *cs)
return did_send;
}
/* perform a synchronous send() for the conn-stream. The CF_WRITE_NULL and
/* perform a synchronous send() for the stream connector. The CF_WRITE_NULL and
* CF_WRITE_PARTIAL flags are cleared prior to the attempt, and will possibly
* be updated in case of success.
*/
void cs_conn_sync_send(struct conn_stream *cs)
void cs_conn_sync_send(struct stconn *cs)
{
struct channel *oc = cs_oc(cs);
@ -1808,12 +1808,12 @@ void cs_conn_sync_send(struct conn_stream *cs)
}
/* Called by I/O handlers after completion.. It propagates
* connection flags to the conn-stream, updates the stream (which may or
* connection flags to the stream connector, updates the stream (which may or
* may not take this opportunity to try to forward data), then update the
* connection's polling based on the channels and conn-stream's final
* connection's polling based on the channels and stream connector's final
* states. The function always returns 0.
*/
static int cs_conn_process(struct conn_stream *cs)
static int cs_conn_process(struct stconn *cs)
{
struct connection *conn = __cs_conn(cs);
struct channel *ic = cs_ic(cs);
@ -1825,7 +1825,7 @@ static int cs_conn_process(struct conn_stream *cs)
if (!channel_is_empty(oc) && !(cs->wait_event.events & SUB_RETRY_SEND))
cs_conn_send(cs);
/* First step, report to the conn-stream what was detected at the
/* First step, report to the stream connector what was detected at the
* connection layer : errors and connection establishment.
* Only add SE_FL_ERROR if we're connected, or we're attempting to
* connect, we may get there because we got woken up, but only run
@ -1887,23 +1887,23 @@ static int cs_conn_process(struct conn_stream *cs)
if (sc_ep_test(cs, SE_FL_EOI) && !(ic->flags & CF_EOI))
ic->flags |= (CF_EOI|CF_READ_PARTIAL);
/* Second step : update the conn-stream and channels, try to forward any
/* Second step : update the stream connector and channels, try to forward any
* pending data, then possibly wake the stream up based on the new
* conn-stream status.
* stream connector status.
*/
cs_notify(cs);
stream_release_buffers(__cs_strm(cs));
return 0;
}
/* This is the ->process() function for any conn-stream's wait_event task.
* It's assigned during the conn-stream's initialization, for any type of
* conn-stream. Thus it is always safe to perform a tasklet_wakeup() on a
* conn-stream, as the presence of the CS is checked there.
/* This is the ->process() function for any stream connector's wait_event task.
* It's assigned during the stream connector's initialization, for any type of
* stream connector. Thus it is always safe to perform a tasklet_wakeup() on a
* stream connector, as the presence of the CS is checked there.
*/
struct task *cs_conn_io_cb(struct task *t, void *ctx, unsigned int state)
{
struct conn_stream *cs = ctx;
struct stconn *cs = ctx;
int ret = 0;
if (!cs_conn(cs))
@ -1922,10 +1922,10 @@ struct task *cs_conn_io_cb(struct task *t, void *ctx, unsigned int state)
/* Callback to be used by applet handlers upon completion. It updates the stream
* (which may or may not take this opportunity to try to forward data), then
* may re-enable the applet's based on the channels and conn-stream's final
* may re-enable the applet's based on the channels and stream connector's final
* states.
*/
static int cs_applet_process(struct conn_stream *cs)
static int cs_applet_process(struct stconn *cs)
{
struct channel *ic = cs_ic(cs);
@ -1943,7 +1943,7 @@ static int cs_applet_process(struct conn_stream *cs)
if (cs_rx_blocked(cs))
cs_rx_endp_more(cs);
/* update the conn-stream, channels, and possibly wake the stream up */
/* update the stream connector, channels, and possibly wake the stream up */
cs_notify(cs);
stream_release_buffers(__cs_strm(cs));

View File

@ -61,7 +61,7 @@ int conn_create_mux(struct connection *conn)
{
if (conn_is_back(conn)) {
struct server *srv;
struct conn_stream *cs = conn->ctx;
struct stconn *cs = conn->ctx;
struct session *sess = conn->owner;
if (conn->flags & CO_FL_ERROR)
@ -1157,7 +1157,7 @@ int conn_recv_proxy(struct connection *conn, int flag)
* flags (the bit is provided in <flag> by the caller). It is designed to be
* called by the connection handler and relies on it to commit polling changes.
* Note that it can emit a PROXY line by relying on the other end's address
* when the connection is attached to a conn-stream, or by resolving the
* when the connection is attached to a stream connector, or by resolving the
* local address otherwise (also called a LOCAL line).
*/
int conn_send_proxy(struct connection *conn, unsigned int flag)
@ -1170,11 +1170,11 @@ int conn_send_proxy(struct connection *conn, unsigned int flag)
* we've sent the whole proxy line. Otherwise we use connect().
*/
if (conn->send_proxy_ofs) {
struct conn_stream *cs;
struct stconn *cs;
int ret;
/* If there is no mux attached to the connection, it means the
* connection context is a conn-stream.
* connection context is a stream connector.
*/
cs = (conn->mux ? cs_conn_get_first(conn) : conn->ctx);
@ -1184,7 +1184,7 @@ int conn_send_proxy(struct connection *conn, unsigned int flag)
* (which is recomputed every time since it's constant). If
* it is positive, it means we have to send from the start.
* We can only send a "normal" PROXY line when the connection
* is attached to a conn-stream. Otherwise we can only
* is attached to a stream connector. Otherwise we can only
* send a LOCAL line (eg: for use with health checks).
*/

View File

@ -253,7 +253,7 @@ void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx)
else if (task->process == task_run_applet && task->context)
s = cs_strm(appctx_cs((struct appctx *)task->context));
else if (task->process == cs_conn_io_cb && task->context)
s = cs_strm(((struct conn_stream *)task->context));
s = cs_strm(((struct stconn *)task->context));
if (s)
stream_dump(buf, s, pfx, '\n');
@ -290,7 +290,7 @@ void ha_task_dump(struct buffer *buf, const struct task *task, const char *pfx)
*/
static int cli_io_handler_show_threads(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
int thr;
if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))
@ -1044,7 +1044,7 @@ static int debug_parse_cli_fd(char **args, char *payload, struct appctx *appctx,
static int debug_iohandler_fd(struct appctx *appctx)
{
struct dev_fd_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct sockaddr_storage sa;
struct stat statbuf;
socklen_t salen, vlen;
@ -1239,7 +1239,7 @@ static int debug_parse_cli_memstats(char **args, char *payload, struct appctx *a
static int debug_iohandler_memstats(struct appctx *appctx)
{
struct dev_mem_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct mem_stats *ptr = ctx->start;
int ret = 1;

View File

@ -438,7 +438,7 @@ out:
*/
static void dns_session_io_handler(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct dns_session *ds = appctx->svcctx;
struct ring *ring = &ds->ring;
struct buffer *buf = &ring->buf;

View File

@ -1137,7 +1137,7 @@ spoe_handle_healthcheck_response(char *frame, size_t size, char *err, int errlen
static int
spoe_send_frame(struct appctx *appctx, char *buf, size_t framesz)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
int ret;
uint32_t netint;
@ -1163,7 +1163,7 @@ spoe_send_frame(struct appctx *appctx, char *buf, size_t framesz)
static int
spoe_recv_frame(struct appctx *appctx, char *buf, size_t framesz)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
int ret;
uint32_t netint;
@ -1265,7 +1265,7 @@ spoe_init_appctx(struct appctx *appctx)
static void
spoe_release_appctx(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct spoe_appctx *spoe_appctx = SPOE_APPCTX(appctx);
struct spoe_agent *agent;
struct spoe_context *ctx, *back;
@ -1385,7 +1385,7 @@ spoe_release_appctx(struct appctx *appctx)
static int
spoe_handle_connect_appctx(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct spoe_agent *agent = SPOE_APPCTX(appctx)->agent;
char *frame, *buf;
int ret;
@ -1451,7 +1451,7 @@ spoe_handle_connect_appctx(struct appctx *appctx)
static int
spoe_handle_connecting_appctx(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct spoe_agent *agent = SPOE_APPCTX(appctx)->agent;
char *frame;
int ret;
@ -1704,7 +1704,7 @@ spoe_handle_receiving_frame_appctx(struct appctx *appctx, int *skip)
static int
spoe_handle_processing_appctx(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct server *srv = objt_server(__cs_strm(cs)->target);
struct spoe_agent *agent = SPOE_APPCTX(appctx)->agent;
int ret, skip_sending = 0, skip_receiving = 0, active_s = 0, active_r = 0, close_asap = 0;
@ -1827,7 +1827,7 @@ spoe_handle_processing_appctx(struct appctx *appctx)
static int
spoe_handle_disconnect_appctx(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct spoe_agent *agent = SPOE_APPCTX(appctx)->agent;
char *frame, *buf;
int ret;
@ -1880,7 +1880,7 @@ spoe_handle_disconnect_appctx(struct appctx *appctx)
static int
spoe_handle_disconnecting_appctx(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
char *frame;
int ret;
@ -1945,7 +1945,7 @@ spoe_handle_disconnecting_appctx(struct appctx *appctx)
static void
spoe_handle_appctx(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct spoe_agent *agent;
if (SPOE_APPCTX(appctx) == NULL)

View File

@ -258,7 +258,7 @@ static int h3_is_frame_valid(struct h3c *h3c, struct qcs *qcs, uint64_t ftype)
}
/* Parse from buffer <buf> a H3 HEADERS frame of length <len>. Data are copied
* in a local HTX buffer and transfer to the conn-stream layer. <fin> must be
* in a local HTX buffer and transfer to the stream connector layer. <fin> must be
* set if this is the last data to transfer from this stream.
*
* Returns the number of bytes handled or a negative error code.
@ -344,7 +344,7 @@ static int h3_headers_to_htx(struct qcs *qcs, struct ncbuf *buf, uint64_t len,
if (!qc_attach_cs(qcs, &htx_buf))
return -1;
/* buffer is transferred to conn_stream and set to NULL
/* buffer is transferred to the stream connector and set to NULL
* except on stream creation error.
*/
b_free(&htx_buf);
@ -828,8 +828,8 @@ static int h3_resp_data_send(struct qcs *qcs, struct buffer *buf, size_t count)
}
/* Not enough room for headers and at least one data byte, block the
* stream. It is expected that the conn-stream layer will subscribe on
* SEND.
* stream. It is expected that the stream connector layer will subscribe
* on SEND.
*/
if (b_size(&outbuf) <= hsize) {
qcs->flags |= QC_SF_BLK_MROOM;
@ -860,7 +860,7 @@ static int h3_resp_data_send(struct qcs *qcs, struct buffer *buf, size_t count)
return total;
}
size_t h3_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags)
size_t h3_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
size_t total = 0;
struct qcs *qcs = __cs_mux(cs);

View File

@ -1933,7 +1933,7 @@ __LJMP static struct hlua_socket *hlua_checksocket(lua_State *L, int ud)
static void hlua_socket_handler(struct appctx *appctx)
{
struct hlua_csk_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
if (ctx->die) {
cs_shutw(cs);
@ -1996,7 +1996,7 @@ static int hlua_socket_init(struct appctx *appctx)
s = appctx_strm(appctx);
/* Configure "right" conn-stream. this "si" is used to connect
/* Configure "right" stream connector. This stconn is used to connect
* and retrieve data from the server. The connection is initialized
* with the "struct server".
*/
@ -2371,7 +2371,7 @@ static int hlua_socket_write_yield(struct lua_State *L,int status, lua_KContext
int sent;
struct xref *peer;
struct stream *s;
struct conn_stream *cs;
struct stconn *cs;
/* Get hlua struct, or NULL if we execute from main lua state */
hlua = hlua_gethlua(L);
@ -2613,7 +2613,7 @@ __LJMP static int hlua_socket_getpeername(struct lua_State *L)
struct hlua_socket *socket;
struct xref *peer;
struct appctx *appctx;
struct conn_stream *cs;
struct stconn *cs;
const struct sockaddr_storage *dst;
int ret;
@ -2777,7 +2777,7 @@ __LJMP static int hlua_socket_connect(struct lua_State *L)
int low, high;
struct sockaddr_storage *addr;
struct xref *peer;
struct conn_stream *cs;
struct stconn *cs;
struct stream *s;
if (lua_gettop(L) < 2)
@ -4479,7 +4479,7 @@ __LJMP static int hlua_applet_tcp_get_priv(lua_State *L)
__LJMP static int hlua_applet_tcp_getline_yield(lua_State *L, int status, lua_KContext ctx)
{
struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_tcp(L, 1));
struct conn_stream *cs = appctx_cs(luactx->appctx);
struct stconn *cs = appctx_cs(luactx->appctx);
int ret;
const char *blk1;
size_t len1;
@ -4533,7 +4533,7 @@ __LJMP static int hlua_applet_tcp_getline(lua_State *L)
__LJMP static int hlua_applet_tcp_recv_yield(lua_State *L, int status, lua_KContext ctx)
{
struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_tcp(L, 1));
struct conn_stream *cs = appctx_cs(luactx->appctx);
struct stconn *cs = appctx_cs(luactx->appctx);
size_t len = MAY_LJMP(luaL_checkinteger(L, 2));
int ret;
const char *blk1;
@ -4641,7 +4641,7 @@ __LJMP static int hlua_applet_tcp_send_yield(lua_State *L, int status, lua_KCont
struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_tcp(L, 1));
const char *str = MAY_LJMP(luaL_checklstring(L, 2, &len));
int l = MAY_LJMP(luaL_checkinteger(L, 3));
struct conn_stream *cs = appctx_cs(luactx->appctx);
struct stconn *cs = appctx_cs(luactx->appctx);
struct channel *chn = cs_ic(cs);
int max;
@ -4968,7 +4968,7 @@ __LJMP static int hlua_applet_http_get_priv(lua_State *L)
__LJMP static int hlua_applet_http_getline_yield(lua_State *L, int status, lua_KContext ctx)
{
struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1));
struct conn_stream *cs = appctx_cs(luactx->appctx);
struct stconn *cs = appctx_cs(luactx->appctx);
struct channel *req = cs_oc(cs);
struct htx *htx;
struct htx_blk *blk;
@ -5063,7 +5063,7 @@ __LJMP static int hlua_applet_http_getline(lua_State *L)
__LJMP static int hlua_applet_http_recv_yield(lua_State *L, int status, lua_KContext ctx)
{
struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1));
struct conn_stream *cs = appctx_cs(luactx->appctx);
struct stconn *cs = appctx_cs(luactx->appctx);
struct channel *req = cs_oc(cs);
struct htx *htx;
struct htx_blk *blk;
@ -5172,7 +5172,7 @@ __LJMP static int hlua_applet_http_recv(lua_State *L)
__LJMP static int hlua_applet_http_send_yield(lua_State *L, int status, lua_KContext ctx)
{
struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1));
struct conn_stream *cs = appctx_cs(luactx->appctx);
struct stconn *cs = appctx_cs(luactx->appctx);
struct channel *res = cs_ic(cs);
struct htx *htx = htx_from_buf(&res->buf);
const char *data;
@ -5309,7 +5309,7 @@ __LJMP static int hlua_applet_http_send_response(lua_State *L)
{
struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1));
struct hlua_http_ctx *http_ctx = luactx->appctx->svcctx;
struct conn_stream *cs = appctx_cs(luactx->appctx);
struct stconn *cs = appctx_cs(luactx->appctx);
struct channel *res = cs_ic(cs);
struct htx *htx;
struct htx_sl *sl;
@ -5506,7 +5506,7 @@ __LJMP static int hlua_applet_http_send_response(lua_State *L)
__LJMP static int hlua_applet_http_start_response_yield(lua_State *L, int status, lua_KContext ctx)
{
struct hlua_appctx *luactx = MAY_LJMP(hlua_checkapplet_http(L, 1));
struct conn_stream *cs = appctx_cs(luactx->appctx);
struct stconn *cs = appctx_cs(luactx->appctx);
struct channel *res = cs_ic(cs);
if (co_data(res)) {
@ -9216,7 +9216,7 @@ struct task *hlua_applet_wakeup(struct task *t, void *context, unsigned int stat
static int hlua_applet_tcp_init(struct appctx *ctx)
{
struct hlua_tcp_ctx *tcp_ctx = applet_reserve_svcctx(ctx, sizeof(*tcp_ctx));
struct conn_stream *cs = appctx_cs(ctx);
struct stconn *cs = appctx_cs(ctx);
struct stream *strm = __cs_strm(cs);
struct hlua *hlua;
struct task *task;
@ -9314,7 +9314,7 @@ static int hlua_applet_tcp_init(struct appctx *ctx)
void hlua_applet_tcp_fct(struct appctx *ctx)
{
struct hlua_tcp_ctx *tcp_ctx = ctx->svcctx;
struct conn_stream *cs = appctx_cs(ctx);
struct stconn *cs = appctx_cs(ctx);
struct stream *strm = __cs_strm(cs);
struct channel *res = cs_ic(cs);
struct act_rule *rule = ctx->rule;
@ -9407,7 +9407,7 @@ static void hlua_applet_tcp_release(struct appctx *ctx)
static int hlua_applet_http_init(struct appctx *ctx)
{
struct hlua_http_ctx *http_ctx = applet_reserve_svcctx(ctx, sizeof(*http_ctx));
struct conn_stream *cs = appctx_cs(ctx);
struct stconn *cs = appctx_cs(ctx);
struct stream *strm = __cs_strm(cs);
struct http_txn *txn;
struct hlua *hlua;
@ -9510,7 +9510,7 @@ static int hlua_applet_http_init(struct appctx *ctx)
void hlua_applet_http_fct(struct appctx *ctx)
{
struct hlua_http_ctx *http_ctx = ctx->svcctx;
struct conn_stream *cs = appctx_cs(ctx);
struct stconn *cs = appctx_cs(ctx);
struct stream *strm = __cs_strm(cs);
struct channel *req = cs_oc(cs);
struct channel *res = cs_ic(cs);
@ -10143,7 +10143,7 @@ static int hlua_cli_io_handler_fct(struct appctx *appctx)
{
struct hlua_cli_ctx *ctx = appctx->svcctx;
struct hlua *hlua;
struct conn_stream *cs;
struct stconn *cs;
struct hlua_function *fcn;
hlua = ctx->hlua;

View File

@ -14,7 +14,7 @@ static int hq_interop_decode_qcs(struct qcs *qcs, int fin, void *ctx)
struct ncbuf *rxbuf = &qcs->rx.ncbuf;
struct htx *htx;
struct htx_sl *sl;
struct conn_stream *cs;
struct stconn *cs;
struct buffer htx_buf = BUF_NULL;
struct ist path;
char *ptr = ncb_head(rxbuf);
@ -93,7 +93,7 @@ static struct buffer *mux_get_buf(struct qcs *qcs)
return &qcs->tx.buf;
}
static size_t hq_interop_snd_buf(struct conn_stream *cs, struct buffer *buf,
static size_t hq_interop_snd_buf(struct stconn *cs, struct buffer *buf,
size_t count, int flags)
{
struct qcs *qcs = __cs_mux(cs);

View File

@ -1228,9 +1228,9 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit)
return 0;
}
/* Reset the stream and the backend conn_stream to a situation suitable for attemption connection */
/* Reset the stream and the backend stream connector to a situation suitable for attemption connection */
/* Returns 0 if we can attempt to retry, -1 otherwise */
static __inline int do_l7_retry(struct stream *s, struct conn_stream *cs)
static __inline int do_l7_retry(struct stream *s, struct stconn *cs)
{
struct channel *req, *res;
int co_data;
@ -4251,7 +4251,7 @@ enum rule_result http_wait_for_msg_body(struct stream *s, struct channel *chn,
goto end;
}
void http_perform_server_redirect(struct stream *s, struct conn_stream *cs)
void http_perform_server_redirect(struct stream *s, struct stconn *cs)
{
struct channel *req = &s->req;
struct channel *res = &s->res;
@ -4640,7 +4640,7 @@ int http_forward_proxy_resp(struct stream *s, int final)
return 1;
}
void http_server_error(struct stream *s, struct conn_stream *cs, int err,
void http_server_error(struct stream *s, struct stconn *cs, int err,
int finst, struct http_reply *msg)
{
http_reply_and_close(s, s->txn->status, msg);
@ -4862,7 +4862,7 @@ int http_reply_message(struct stream *s, struct http_reply *reply)
* Note that connection errors appearing on the second request of a keep-alive
* connection are not reported since this allows the client to retry.
*/
void http_return_srv_error(struct stream *s, struct conn_stream *cs)
void http_return_srv_error(struct stream *s, struct stconn *cs)
{
int err_type = s->conn_err_type;
@ -5165,7 +5165,7 @@ void http_txn_reset_res(struct http_txn *txn)
struct http_txn *http_create_txn(struct stream *s)
{
struct http_txn *txn;
struct conn_stream *cs = s->csf;
struct stconn *cs = s->csf;
txn = pool_alloc(pool_head_http_txn);
if (!txn)

View File

@ -195,7 +195,7 @@ err:
static int hc_cli_io_handler(struct appctx *appctx)
{
struct hcli_svc_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct buffer *trash = alloc_trash_chunk();
struct httpclient *hc = ctx->hc;
struct http_hdr *hdrs, *hdr;
@ -638,7 +638,7 @@ err:
static void httpclient_applet_io_handler(struct appctx *appctx)
{
struct httpclient *hc = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct stream *s = __cs_strm(cs);
struct channel *req = &s->req;
struct channel *res = &s->res;

View File

@ -3559,7 +3559,7 @@ out:
static void syslog_io_handler(struct appctx *appctx)
{
static THREAD_LOCAL struct ist metadata[LOG_META_FIELDS];
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct stream *s = __cs_strm(cs);
struct proxy *frontend = strm_fe(s);
struct listener *l = strm_li(s);

View File

@ -345,7 +345,7 @@ struct show_map_ctx {
static int cli_io_handler_pat_list(struct appctx *appctx)
{
struct show_map_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct pat_ref_elt *elt;
if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW))) {
@ -417,7 +417,7 @@ static int cli_io_handler_pat_list(struct appctx *appctx)
static int cli_io_handler_pats_list(struct appctx *appctx)
{
struct show_map_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
switch (ctx->state) {
case STATE_INIT:
@ -480,7 +480,7 @@ static int cli_io_handler_pats_list(struct appctx *appctx)
static int cli_io_handler_map_lookup(struct appctx *appctx)
{
struct show_map_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct sample sample;
struct pattern *pat;
int match_method;

View File

@ -56,7 +56,7 @@
#define FCGI_CF_DEM_MROOM 0x00000010 /* demux blocked on lack of room in mux buffer */
#define FCGI_CF_DEM_SALLOC 0x00000020 /* demux blocked on lack of stream's rx buffer */
#define FCGI_CF_DEM_SFULL 0x00000040 /* demux blocked on stream request buffer full */
#define FCGI_CF_DEM_TOOMANY 0x00000080 /* demux blocked waiting for some conn_streams to leave */
#define FCGI_CF_DEM_TOOMANY 0x00000080 /* demux blocked waiting for some stream connectors to leave */
#define FCGI_CF_DEM_BLOCK_ANY 0x000000F0 /* aggregate of the demux flags above except DALLOC/DFULL */
/* Other flags */
@ -104,7 +104,7 @@ struct fcgi_conn {
int timeout; /* idle timeout duration in ticks */
int shut_timeout; /* idle timeout duration in ticks after shutdown */
unsigned int nb_streams; /* number of streams in the tree */
unsigned int nb_cs; /* number of attached conn_streams */
unsigned int nb_cs; /* number of attached stream connectors */
unsigned int nb_reserved; /* number of reserved streams */
unsigned int stream_cnt; /* total number of streams seen */
@ -169,7 +169,7 @@ struct fcgi_strm {
struct buffer rxbuf; /* receive buffer, always valid (buf_empty or real buffer) */
struct eb32_node by_id; /* place in fcgi_conn's streams_by_id */
struct wait_event *subs; /* Address of the wait_event the conn_stream associated is waiting on */
struct wait_event *subs; /* Address of the wait_event the stream connector associated is waiting on */
struct list send_list; /* To be used when adding in fcgi_conn->send_list */
struct tasklet *shut_tl; /* deferred shutdown tasklet, to retry to close after we failed to by lack of space */
};
@ -364,7 +364,7 @@ static int fcgi_process(struct fcgi_conn *fconn);
struct task *fcgi_io_cb(struct task *t, void *ctx, unsigned int state);
static inline struct fcgi_strm *fcgi_conn_st_by_id(struct fcgi_conn *fconn, int id);
struct task *fcgi_deferred_shut(struct task *t, void *ctx, unsigned int state);
static struct fcgi_strm *fcgi_conn_stream_new(struct fcgi_conn *fconn, struct conn_stream *cs, struct session *sess);
static struct fcgi_strm *fcgi_stconn_new(struct fcgi_conn *fconn, struct stconn *cs, struct session *sess);
static void fcgi_strm_notify_recv(struct fcgi_strm *fstrm);
static void fcgi_strm_notify_send(struct fcgi_strm *fstrm);
static void fcgi_strm_alert(struct fcgi_strm *fstrm);
@ -789,7 +789,7 @@ static int fcgi_init(struct connection *conn, struct proxy *px, struct session *
* caller calls ->attach(). For now the outgoing cs is stored as
* conn->ctx by the caller and saved in conn_ctx.
*/
fstrm = fcgi_conn_stream_new(fconn, conn_ctx, sess);
fstrm = fcgi_stconn_new(fconn, conn_ctx, sess);
if (!fstrm)
goto fail;
@ -961,7 +961,7 @@ static void fcgi_strm_notify_send(struct fcgi_strm *fstrm)
* - if its subscribed to send, then it's woken up for send
* - if it was subscribed to neither, its ->wake() callback is called
* It is safe to call this function with a closed stream which doesn't have a
* conn_stream anymore.
* stream connector anymore.
*/
static void fcgi_strm_alert(struct fcgi_strm *fstrm)
{
@ -1103,12 +1103,12 @@ static struct fcgi_strm *fcgi_strm_new(struct fcgi_conn *fconn, int id)
return NULL;
}
/* Allocates a new stream associated to conn_stream <cs> on the FCGI connection
/* Allocates a new stream associated to stream connector <cs> on the FCGI connection
* <fconn> and returns it, or NULL in case of memory allocation error or if the
* highest possible stream ID was reached.
*/
static struct fcgi_strm *fcgi_conn_stream_new(struct fcgi_conn *fconn, struct conn_stream *cs,
struct session *sess)
static struct fcgi_strm *fcgi_stconn_new(struct fcgi_conn *fconn, struct stconn *cs,
struct session *sess)
{
struct fcgi_strm *fstrm = NULL;
@ -1144,7 +1144,7 @@ static struct fcgi_strm *fcgi_conn_stream_new(struct fcgi_conn *fconn, struct co
return NULL;
}
/* Wakes a specific stream and assign its conn_stream some SE_FL_* flags among
/* Wakes a specific stream and assign its stream connector some SE_FL_* flags among
* SE_FL_ERR_PENDING and SE_FL_ERROR if needed. The stream's state is
* automatically updated accordingly. If the stream is orphaned, it is
* destroyed.
@ -3527,7 +3527,7 @@ static int fcgi_attach(struct connection *conn, struct sedesc *endp, struct sess
struct fcgi_conn *fconn = conn->ctx;
TRACE_ENTER(FCGI_EV_FSTRM_NEW, conn);
fstrm = fcgi_conn_stream_new(fconn, endp->cs, sess);
fstrm = fcgi_stconn_new(fconn, endp->cs, sess);
if (!fstrm)
goto err;
@ -3543,12 +3543,12 @@ static int fcgi_attach(struct connection *conn, struct sedesc *endp, struct sess
return -1;
}
/* Retrieves the first valid conn_stream from this connection, or returns NULL.
/* Retrieves the first valid stream connector from this connection, or returns NULL.
* We have to scan because we may have some orphan streams. It might be
* beneficial to scan backwards from the end to reduce the likeliness to find
* orphans.
*/
static struct conn_stream *fcgi_get_first_cs(const struct connection *conn)
static struct stconn *fcgi_get_first_cs(const struct connection *conn)
{
struct fcgi_conn *fconn = conn->ctx;
struct fcgi_strm *fstrm;
@ -3852,8 +3852,8 @@ struct task *fcgi_deferred_shut(struct task *t, void *ctx, unsigned int state)
return NULL;
}
/* shutr() called by the conn_stream (mux_ops.shutr) */
static void fcgi_shutr(struct conn_stream *cs, enum co_shr_mode mode)
/* shutr() called by the stream conector (mux_ops.shutr) */
static void fcgi_shutr(struct stconn *cs, enum co_shr_mode mode)
{
struct fcgi_strm *fstrm = __cs_mux(cs);
@ -3863,8 +3863,8 @@ static void fcgi_shutr(struct conn_stream *cs, enum co_shr_mode mode)
fcgi_do_shutr(fstrm);
}
/* shutw() called by the conn_stream (mux_ops.shutw) */
static void fcgi_shutw(struct conn_stream *cs, enum co_shw_mode mode)
/* shutw() called by the stream connector (mux_ops.shutw) */
static void fcgi_shutw(struct stconn *cs, enum co_shw_mode mode)
{
struct fcgi_strm *fstrm = __cs_mux(cs);
@ -3877,7 +3877,7 @@ static void fcgi_shutw(struct conn_stream *cs, enum co_shw_mode mode)
* as at least one event is still subscribed. The <event_type> must only be a
* combination of SUB_RETRY_RECV and SUB_RETRY_SEND. It always returns 0.
*/
static int fcgi_subscribe(struct conn_stream *cs, int event_type, struct wait_event *es)
static int fcgi_subscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
struct fcgi_strm *fstrm = __cs_mux(cs);
struct fcgi_conn *fconn = fstrm->fconn;
@ -3903,7 +3903,7 @@ static int fcgi_subscribe(struct conn_stream *cs, int event_type, struct wait_ev
* (undo fcgi_subscribe). The <es> pointer is not allowed to differ from the one
* passed to the subscribe() call. It always returns zero.
*/
static int fcgi_unsubscribe(struct conn_stream *cs, int event_type, struct wait_event *es)
static int fcgi_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
struct fcgi_strm *fstrm = __cs_mux(cs);
struct fcgi_conn *fconn = fstrm->fconn;
@ -3939,7 +3939,7 @@ static int fcgi_unsubscribe(struct conn_stream *cs, int event_type, struct wait_
* mux it may optimize the data copy to <buf> if necessary. Otherwise, it should
* copy as much data as possible.
*/
static size_t fcgi_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags)
static size_t fcgi_rcv_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
struct fcgi_strm *fstrm = __cs_mux(cs);
struct fcgi_conn *fconn = fstrm->fconn;
@ -3981,9 +3981,9 @@ static size_t fcgi_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t co
/* Called from the upper layer, to send data from buffer <buf> for no more than
* <count> bytes. Returns the number of bytes effectively sent. Some status
* flags may be updated on the conn_stream.
* flags may be updated on the stream connector.
*/
static size_t fcgi_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags)
static size_t fcgi_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
struct fcgi_strm *fstrm = __cs_mux(cs);
struct fcgi_conn *fconn = fstrm->fconn;

View File

@ -1,5 +1,5 @@
/*
* HTT/1 mux-demux for connections
* HTTP/1 mux-demux for connections
*
* Copyright 2018 Christopher Faulet <cfaulet@haproxy.com>
*
@ -47,13 +47,13 @@
#define H1C_F_IN_SALLOC 0x00000040 /* mux is blocked on lack of stream's request buffer */
/* Flags indicating the connection state */
#define H1C_F_ST_EMBRYONIC 0x00000100 /* Set when a H1 stream with no conn-stream is attached to the connection */
#define H1C_F_ST_ATTACHED 0x00000200 /* Set when a H1 stream with a conn-stream is attached to the connection (may be not READY) */
#define H1C_F_ST_EMBRYONIC 0x00000100 /* Set when a H1 stream with no stream connector is attached to the connection */
#define H1C_F_ST_ATTACHED 0x00000200 /* Set when a H1 stream with a stream connector is attached to the connection (may be not READY) */
#define H1C_F_ST_IDLE 0x00000400 /* connection is idle and may be reused
* (exclusive to all H1C_F_ST flags and never set when an h1s is attached) */
#define H1C_F_ST_ERROR 0x00000800 /* connection must be closed ASAP because an error occurred (conn-stream may still be attached) */
#define H1C_F_ST_SHUTDOWN 0x00001000 /* connection must be shut down ASAP flushing output first (conn-stream may still be attached) */
#define H1C_F_ST_READY 0x00002000 /* Set in ATTACHED state with a READY conn-stream. A conn-stream is not ready when
#define H1C_F_ST_ERROR 0x00000800 /* connection must be closed ASAP because an error occurred (stream connector may still be attached) */
#define H1C_F_ST_SHUTDOWN 0x00001000 /* connection must be shut down ASAP flushing output first (stream connector may still be attached) */
#define H1C_F_ST_READY 0x00002000 /* Set in ATTACHED state with a READY stream connector. A stream connector is not ready when
* a TCP>H1 upgrade is in progress Thus this flag is only set if ATTACHED is also set */
#define H1C_F_ST_ALIVE (H1C_F_ST_IDLE|H1C_F_ST_EMBRYONIC|H1C_F_ST_ATTACHED)
#define H1C_F_ST_SILENT_SHUT 0x00004000 /* silent (or dirty) shutdown must be performed (implied ST_SHUTDOWN) */
@ -121,7 +121,7 @@ struct h1s {
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 */
struct wait_event *subs; /* Address of the wait_event the stream connector associated is waiting on */
struct session *sess; /* Associated session */
struct buffer rxbuf; /* receive buffer, always valid (buf_empty or real buffer) */
@ -620,7 +620,7 @@ static void h1_refresh_timeout(struct h1c *h1c)
is_idle_conn = 1;
}
else {
/* alive back connections of front connections with a conn-stream attached */
/* alive back connections of front connections with a stream connector attached */
h1c->task->expire = TICK_ETERNITY;
TRACE_DEVEL("no connection timeout (alive back h1c or front h1c with a CS)", H1_EV_H1C_SEND|H1_EV_H1C_RECV, h1c->conn);
}
@ -708,14 +708,14 @@ static inline size_t h1s_data_pending(const struct h1s *h1s)
return ((h1m->state == H1_MSG_DONE) ? 0 : b_data(&h1s->h1c->ibuf));
}
/* Creates a new conn-stream and the associate stream. <input> is used as input
/* Creates a new stream connector and the associate stream. <input> is used as input
* buffer for the stream. On success, it is transferred to the stream and the
* mux is no longer responsible of it. On error, <input> is unchanged, thus the
* mux must still take care of it. However, there is nothing special to do
* because, on success, <input> is updated to points on BUF_NULL. Thus, calling
* b_free() on it is always safe. This function returns the conn-stream on
* b_free() on it is always safe. This function returns the stream connector on
* success or NULL on error. */
static struct conn_stream *h1s_new_cs(struct h1s *h1s, struct buffer *input)
static struct stconn *h1s_new_cs(struct h1s *h1s, struct buffer *input)
{
struct h1c *h1c = h1s->h1c;
@ -743,7 +743,7 @@ static struct conn_stream *h1s_new_cs(struct h1s *h1s, struct buffer *input)
return NULL;
}
static struct conn_stream *h1s_upgrade_cs(struct h1s *h1s, struct buffer *input)
static struct stconn *h1s_upgrade_cs(struct h1s *h1s, struct buffer *input)
{
TRACE_ENTER(H1_EV_STRM_NEW, h1s->h1c->conn, h1s);
@ -802,7 +802,7 @@ static struct h1s *h1s_new(struct h1c *h1c)
return NULL;
}
static struct h1s *h1c_frt_stream_new(struct h1c *h1c, struct conn_stream *cs, struct session *sess)
static struct h1s *h1c_frt_stream_new(struct h1c *h1c, struct stconn *cs, struct session *sess)
{
struct h1s *h1s;
@ -842,7 +842,7 @@ static struct h1s *h1c_frt_stream_new(struct h1c *h1c, struct conn_stream *cs, s
return NULL;
}
static struct h1s *h1c_bck_stream_new(struct h1c *h1c, struct conn_stream *cs, struct session *sess)
static struct h1s *h1c_bck_stream_new(struct h1c *h1c, struct stconn *cs, struct session *sess)
{
struct h1s *h1s;
@ -919,8 +919,8 @@ static void h1s_destroy(struct h1s *h1s)
/*
* Initialize the mux once it's attached. It is expected that conn->ctx points
* to the existing conn_stream (for outgoing connections or for incoming ones
* during a mux upgrade) or NULL (for incoming ones during the connection
* to the existing stream connector (for outgoing connections or for incoming
* ones during a mux upgrade) or NULL (for incoming ones during the connection
* establishment). <input> is always used as Input buffer and may contain
* data. It is the caller responsibility to not reuse it anymore. Returns < 0 on
* error.
@ -1913,7 +1913,7 @@ static size_t h1_process_demux(struct h1c *h1c, struct buffer *buf, size_t count
se_fl_clr(h1s->endp, SE_FL_MAY_SPLICE);
}
/* Set EOI on conn-stream in DONE state iff:
/* Set EOI on stream connector in DONE state iff:
* - it is a response
* - it is a request but no a protocol upgrade nor a CONNECT
*
@ -1941,7 +1941,7 @@ static size_t h1_process_demux(struct h1c *h1c, struct buffer *buf, size_t count
se_fl_set(h1s->endp, SE_FL_EOS);
if (h1m->state >= H1_MSG_DONE || !(h1m->flags & H1_MF_XFER_LEN)) {
/* DONE or TUNNEL or SHUTR without XFER_LEN, set
* EOI on the conn-stream */
* EOI on the stream connector */
se_fl_set(h1s->endp, SE_FL_EOI);
}
else if (h1m->state > H1_MSG_LAST_LF && h1m->state < H1_MSG_DONE) {
@ -2563,7 +2563,7 @@ static size_t h1_process_mux(struct h1c *h1c, struct buffer *buf, size_t count)
}
end:
/* Both the request and the response reached the DONE state. So set EOI
* flag on the conn-stream. Most of time, the flag will already be set,
* flag on the stream connector. Most of time, the flag will already be set,
* except for protocol upgrades. Report an error if data remains blocked
* in the output buffer.
*/
@ -3022,7 +3022,7 @@ static int h1_process(struct h1c * h1c)
(h1c->flags & H1C_F_ST_ERROR) ||
((h1c->flags & H1C_F_ST_SILENT_SHUT) && !b_data(&h1c->obuf))) {
if (!(h1c->flags & H1C_F_ST_READY)) {
/* No conn-stream or not ready */
/* No stream connector or not ready */
/* shutdown for reads and error on the frontend connection: Send an error */
if (!(h1c->flags & (H1C_F_IS_BACK|H1C_F_ST_ERROR|H1C_F_ST_SHUTDOWN))) {
if (h1_handle_parsing_error(h1c))
@ -3045,7 +3045,7 @@ static int h1_process(struct h1c * h1c)
goto release;
}
else {
/* Here there is still a H1 stream with a conn-stream.
/* Here there is still a H1 stream with a stream connector.
* Report the connection state at the stream level
*/
if (conn_xprt_read0_pending(conn)) {
@ -3237,7 +3237,7 @@ struct task *h1_timeout_task(struct task *t, void *context, unsigned int state)
return t;
}
/* If a conn-stream is still attached and ready to the mux, wait for the
/* If a stream connector is still attached and ready to the mux, wait for the
* stream's timeout
*/
if (h1c->flags & H1C_F_ST_READY) {
@ -3331,10 +3331,10 @@ static int h1_attach(struct connection *conn, struct sedesc *endp, struct sessio
return -1;
}
/* Retrieves a valid conn_stream from this connection, or returns NULL. For
* this mux, it's easy as we can only store a single conn_stream.
/* Retrieves a valid stream connector from this connection, or returns NULL.
* For this mux, it's easy as we can only store a single stream connector.
*/
static struct conn_stream *h1_get_first_cs(const struct connection *conn)
static struct stconn *h1_get_first_cs(const struct connection *conn)
{
struct h1c *h1c = conn->ctx;
struct h1s *h1s = h1c->h1s;
@ -3464,7 +3464,7 @@ static void h1_detach(struct sedesc *endp)
}
static void h1_shutr(struct conn_stream *cs, enum co_shr_mode mode)
static void h1_shutr(struct stconn *cs, enum co_shr_mode mode)
{
struct h1s *h1s = __cs_mux(cs);
struct h1c *h1c;
@ -3507,7 +3507,7 @@ static void h1_shutr(struct conn_stream *cs, enum co_shr_mode mode)
TRACE_LEAVE(H1_EV_STRM_SHUT, h1c->conn, h1s);
}
static void h1_shutw(struct conn_stream *cs, enum co_shw_mode mode)
static void h1_shutw(struct stconn *cs, enum co_shw_mode mode)
{
struct h1s *h1s = __cs_mux(cs);
struct h1c *h1c;
@ -3567,7 +3567,7 @@ static void h1_shutw_conn(struct connection *conn)
* The <es> pointer is not allowed to differ from the one passed to the
* subscribe() call. It always returns zero.
*/
static int h1_unsubscribe(struct conn_stream *cs, int event_type, struct wait_event *es)
static int h1_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
struct h1s *h1s = __cs_mux(cs);
@ -3594,9 +3594,10 @@ static int h1_unsubscribe(struct conn_stream *cs, int event_type, struct wait_ev
* event subscriber <es> is not allowed to change from a previous call as long
* as at least one event is still subscribed. The <event_type> must only be a
* combination of SUB_RETRY_RECV and SUB_RETRY_SEND. It always returns 0, unless
* the conn_stream <cs> was already detached, in which case it will return -1.
* the stream connector <cs> was already detached, in which case it will return
* -1.
*/
static int h1_subscribe(struct conn_stream *cs, int event_type, struct wait_event *es)
static int h1_subscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
struct h1s *h1s = __cs_mux(cs);
struct h1c *h1c;
@ -3617,7 +3618,7 @@ static int h1_subscribe(struct conn_stream *cs, int event_type, struct wait_even
if (event_type & SUB_RETRY_SEND) {
TRACE_DEVEL("subscribe(send)", H1_EV_STRM_SEND, h1s->h1c->conn, h1s);
/*
* If the conn_stream attempt to subscribe, and the
* If the stconn attempts to subscribe, and the
* mux isn't subscribed to the connection, then it
* probably means the connection wasn't established
* yet, so we have to subscribe.
@ -3644,7 +3645,7 @@ static int h1_subscribe(struct conn_stream *cs, int event_type, struct wait_even
* mux it may optimize the data copy to <buf> if necessary. Otherwise, it should
* copy as much data as possible.
*/
static size_t h1_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags)
static size_t h1_rcv_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
struct h1s *h1s = __cs_mux(cs);
struct h1c *h1c = h1s->h1c;
@ -3680,7 +3681,7 @@ static size_t h1_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
/* Called from the upper layer, to send data */
static size_t h1_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags)
static size_t h1_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
struct h1s *h1s = __cs_mux(cs);
struct h1c *h1c;
@ -3745,7 +3746,7 @@ static size_t h1_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
#if defined(USE_LINUX_SPLICE)
/* Send and get, using splicing */
static int h1_rcv_pipe(struct conn_stream *cs, struct pipe *pipe, unsigned int count)
static int h1_rcv_pipe(struct stconn *cs, struct pipe *pipe, unsigned int count)
{
struct h1s *h1s = __cs_mux(cs);
struct h1c *h1c = h1s->h1c;
@ -3815,7 +3816,7 @@ static int h1_rcv_pipe(struct conn_stream *cs, struct pipe *pipe, unsigned int c
return ret;
}
static int h1_snd_pipe(struct conn_stream *cs, struct pipe *pipe)
static int h1_snd_pipe(struct stconn *cs, struct pipe *pipe)
{
struct h1s *h1s = __cs_mux(cs);
struct h1c *h1c = h1s->h1c;

View File

@ -58,7 +58,7 @@ static const struct h2s *h2_idle_stream;
#define H2_CF_DEM_MROOM 0x00000020 // demux blocked on lack of room in mux buffer
#define H2_CF_DEM_SALLOC 0x00000040 // demux blocked on lack of stream's request buffer
#define H2_CF_DEM_SFULL 0x00000080 // demux blocked on stream request buffer full
#define H2_CF_DEM_TOOMANY 0x00000100 // demux blocked waiting for some conn_streams to leave
#define H2_CF_DEM_TOOMANY 0x00000100 // demux blocked waiting for some stream connectors to leave
#define H2_CF_DEM_BLOCK_ANY 0x000001F0 // aggregate of the demux flags above except DALLOC/DFULL
// (SHORT_READ is also excluded)
@ -136,7 +136,7 @@ struct h2c {
int idle_start; /* date of the last time the connection went idle */
/* 32-bit hole here */
unsigned int nb_streams; /* number of streams in the tree */
unsigned int nb_cs; /* number of attached conn_streams */
unsigned int nb_cs; /* number of attached stream connectors */
unsigned int nb_reserved; /* number of reserved streams */
unsigned int stream_cnt; /* total number of streams seen */
struct proxy *proxy; /* the proxy this connection was created for */
@ -224,7 +224,7 @@ struct h2s {
uint16_t status; /* HTTP response status */
unsigned long long body_len; /* remaining body length according to content-length if H2_SF_DATA_CLEN */
struct buffer rxbuf; /* receive buffer, always valid (buf_empty or real buffer) */
struct wait_event *subs; /* recv wait_event the conn_stream associated is waiting on (via h2_subscribe) */
struct wait_event *subs; /* recv wait_event the stream connector associated is waiting on (via h2_subscribe) */
struct list list; /* To be used when adding in h2c->send_list or h2c->fctl_lsit */
struct tasklet *shut_tl; /* deferred shutdown tasklet, to retry to send an RST after we failed to,
* in case there's no other subscription to do it */
@ -577,7 +577,7 @@ static inline struct h2s *h2c_st_by_id(struct h2c *h2c, int id);
static int h2c_decode_headers(struct h2c *h2c, struct buffer *rxbuf, uint32_t *flags, unsigned long long *body_len, char *upgrade_protocol);
static int h2_frt_transfer_data(struct h2s *h2s);
struct task *h2_deferred_shut(struct task *t, void *ctx, unsigned int state);
static struct h2s *h2c_bck_stream_new(struct h2c *h2c, struct conn_stream *cs, struct session *sess);
static struct h2s *h2c_bck_stream_new(struct h2c *h2c, struct stconn *cs, struct session *sess);
static void h2s_alert(struct h2s *h2s);
/* returns a h2c state as an abbreviated 3-letter string, or "???" if unknown */
@ -849,7 +849,7 @@ static inline void h2c_restart_reading(const struct h2c *h2c, int consider_buffe
}
/* returns true if the front connection has too many conn_streams attached */
/* returns true if the front connection has too many stream connectors attached */
static inline int h2_frt_has_too_many_cs(const struct h2c *h2c)
{
return h2c->nb_cs > h2_settings_max_concurrent_streams;
@ -1317,7 +1317,7 @@ static void __maybe_unused h2s_notify_send(struct h2s *h2s)
* - if its subscribed to send, then it's woken up for send
* - if it was subscribed to neither, its ->wake() callback is called
* It is safe to call this function with a closed stream which doesn't have a
* conn_stream anymore.
* stream connector anymore.
*/
static void __maybe_unused h2s_alert(struct h2s *h2s)
{
@ -1660,11 +1660,11 @@ static struct h2s *h2c_frt_stream_new(struct h2c *h2c, int id, struct buffer *in
return NULL;
}
/* allocates a new stream associated to conn_stream <cs> on the h2c connection
* and returns it, or NULL in case of memory allocation error or if the highest
* possible stream ID was reached.
/* allocates a new stream associated to stream connector <cs> on the h2c
* connection and returns it, or NULL in case of memory allocation error or if
* the highest possible stream ID was reached.
*/
static struct h2s *h2c_bck_stream_new(struct h2c *h2c, struct conn_stream *cs, struct session *sess)
static struct h2s *h2c_bck_stream_new(struct h2c *h2c, struct stconn *cs, struct session *sess)
{
struct h2s *h2s = NULL;
@ -2185,8 +2185,8 @@ static int h2_send_empty_data_es(struct h2s *h2s)
return ret;
}
/* wake a specific stream and assign its conn_stream some SE_FL_* flags among
* SE_FL_ERR_PENDING and SE_FL_ERROR if needed. The stream's state
/* wake a specific stream and assign its stream connector some SE_FL_* flags
* among SE_FL_ERR_PENDING and SE_FL_ERROR if needed. The stream's state
* is automatically updated accordingly. If the stream is orphaned, it is
* destroyed.
*/
@ -4309,12 +4309,12 @@ static int h2_attach(struct connection *conn, struct sedesc *endp, struct sessio
return 0;
}
/* Retrieves the first valid conn_stream from this connection, or returns NULL.
* We have to scan because we may have some orphan streams. It might be
/* Retrieves the first valid stream connector from this connection, or returns
* NULL. We have to scan because we may have some orphan streams. It might be
* beneficial to scan backwards from the end to reduce the likeliness to find
* orphans.
*/
static struct conn_stream *h2_get_first_cs(const struct connection *conn)
static struct stconn *h2_get_first_cs(const struct connection *conn)
{
struct h2c *h2c = conn->ctx;
struct h2s *h2s;
@ -4685,8 +4685,8 @@ struct task *h2_deferred_shut(struct task *t, void *ctx, unsigned int state)
return t;
}
/* shutr() called by the conn_stream (mux_ops.shutr) */
static void h2_shutr(struct conn_stream *cs, enum co_shr_mode mode)
/* shutr() called by the stream connector (mux_ops.shutr) */
static void h2_shutr(struct stconn *cs, enum co_shr_mode mode)
{
struct h2s *h2s = __cs_mux(cs);
@ -4696,8 +4696,8 @@ static void h2_shutr(struct conn_stream *cs, enum co_shr_mode mode)
TRACE_LEAVE(H2_EV_STRM_SHUT, h2s->h2c->conn, h2s);
}
/* shutw() called by the conn_stream (mux_ops.shutw) */
static void h2_shutw(struct conn_stream *cs, enum co_shw_mode mode)
/* shutw() called by the stream connector (mux_ops.shutw) */
static void h2_shutw(struct stconn *cs, enum co_shw_mode mode)
{
struct h2s *h2s = __cs_mux(cs);
@ -6371,7 +6371,7 @@ static size_t h2s_make_trailers(struct h2s *h2s, struct htx *htx)
* as at least one event is still subscribed. The <event_type> must only be a
* combination of SUB_RETRY_RECV and SUB_RETRY_SEND. It always returns 0.
*/
static int h2_subscribe(struct conn_stream *cs, int event_type, struct wait_event *es)
static int h2_subscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
struct h2s *h2s = __cs_mux(cs);
struct h2c *h2c = h2s->h2c;
@ -6405,7 +6405,7 @@ static int h2_subscribe(struct conn_stream *cs, int event_type, struct wait_even
* The <es> pointer is not allowed to differ from the one passed to the
* subscribe() call. It always returns zero.
*/
static int h2_unsubscribe(struct conn_stream *cs, int event_type, struct wait_event *es)
static int h2_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
struct h2s *h2s = __cs_mux(cs);
@ -6445,7 +6445,7 @@ static int h2_unsubscribe(struct conn_stream *cs, int event_type, struct wait_ev
* mux it may optimize the data copy to <buf> if necessary. Otherwise, it should
* copy as much data as possible.
*/
static size_t h2_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags)
static size_t h2_rcv_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
struct h2s *h2s = __cs_mux(cs);
struct h2c *h2c = h2s->h2c;
@ -6526,9 +6526,9 @@ static size_t h2_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
/* Called from the upper layer, to send data from buffer <buf> for no more than
* <count> bytes. Returns the number of bytes effectively sent. Some status
* flags may be updated on the conn_stream.
* flags may be updated on the stream connector.
*/
static size_t h2_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags)
static size_t h2_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
struct h2s *h2s = __cs_mux(cs);
size_t total = 0;
@ -6678,7 +6678,7 @@ static size_t h2_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
}
/* If we're waiting for flow control, and we got a shutr on the
* connection, we will never be unlocked, so add an error on
* the conn_stream.
* the stream connector.
*/
if (conn_xprt_read0_pending(h2s->h2c->conn) &&
!b_data(&h2s->h2c->dbuf) &&

View File

@ -124,7 +124,7 @@ static inline void pt_trace_buf(const struct buffer *buf, size_t ofs, size_t len
/* the PT traces always expect that arg1, if non-null, is of type connection
* (from which we can derive the pt context), that arg2, if non-null, is a
* conn-stream, and that arg3, if non-null, is a buffer.
* stream connector, and that arg3, if non-null, is a buffer.
*/
static void pt_trace(enum trace_level level, uint64_t mask, const struct trace_source *src,
const struct ist where, const struct ist func,
@ -132,7 +132,7 @@ static void pt_trace(enum trace_level level, uint64_t mask, const struct trace_s
{
const struct connection *conn = a1;
const struct mux_pt_ctx *ctx = conn ? conn->ctx : NULL;
const struct conn_stream *cs = a2;
const struct stconn *cs = a2;
const struct buffer *buf = a3;
const size_t *val = a4;
@ -266,15 +266,15 @@ struct task *mux_pt_io_cb(struct task *t, void *tctx, unsigned int status)
return t;
}
/* 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
/* Initialize the mux once it's attached. It is expected that conn->ctx points
* to the existing stream connector (for outgoing connections) or NULL (for
* incoming ones, in which case one will be allocated and a new stream will be
* instantiated). Returns < 0 on error.
*/
static int mux_pt_init(struct connection *conn, struct proxy *prx, struct session *sess,
struct buffer *input)
{
struct conn_stream *cs = conn->ctx;
struct stconn *cs = conn->ctx;
struct mux_pt_ctx *ctx = pool_alloc(pool_head_pt_ctx);
TRACE_ENTER(PT_EV_CONN_NEW);
@ -389,10 +389,10 @@ static int mux_pt_attach(struct connection *conn, struct sedesc *endp, struct se
return 0;
}
/* Retrieves a valid conn_stream from this connection, or returns NULL. For
* this mux, it's easy as we can only store a single conn_stream.
/* Retrieves a valid stream connector from this connection, or returns NULL.
* For this mux, it's easy as we can only store a single stream connector.
*/
static struct conn_stream *mux_pt_get_first_cs(const struct connection *conn)
static struct stconn *mux_pt_get_first_cs(const struct connection *conn)
{
struct mux_pt_ctx *ctx = conn->ctx;
@ -453,7 +453,7 @@ static int mux_pt_avail_streams(struct connection *conn)
return 1 - mux_pt_used_streams(conn);
}
static void mux_pt_shutr(struct conn_stream *cs, enum co_shr_mode mode)
static void mux_pt_shutr(struct stconn *cs, enum co_shr_mode mode)
{
struct connection *conn = __cs_conn(cs);
struct mux_pt_ctx *ctx = conn->ctx;
@ -474,7 +474,7 @@ static void mux_pt_shutr(struct conn_stream *cs, enum co_shr_mode mode)
TRACE_LEAVE(PT_EV_STRM_SHUT, conn, cs);
}
static void mux_pt_shutw(struct conn_stream *cs, enum co_shw_mode mode)
static void mux_pt_shutw(struct stconn *cs, enum co_shw_mode mode)
{
struct connection *conn = __cs_conn(cs);
struct mux_pt_ctx *ctx = conn->ctx;
@ -507,7 +507,7 @@ static void mux_pt_shutw(struct conn_stream *cs, enum co_shw_mode mode)
* mux it may optimize the data copy to <buf> if necessary. Otherwise, it should
* copy as much data as possible.
*/
static size_t mux_pt_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags)
static size_t mux_pt_rcv_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
struct connection *conn = __cs_conn(cs);
struct mux_pt_ctx *ctx = conn->ctx;
@ -537,7 +537,7 @@ static size_t mux_pt_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t
}
/* Called from the upper layer, to send data */
static size_t mux_pt_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t count, int flags)
static size_t mux_pt_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
struct connection *conn = __cs_conn(cs);
struct mux_pt_ctx *ctx = conn->ctx;
@ -564,7 +564,7 @@ static size_t mux_pt_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t
* as at least one event is still subscribed. The <event_type> must only be a
* combination of SUB_RETRY_RECV and SUB_RETRY_SEND. It always returns 0.
*/
static int mux_pt_subscribe(struct conn_stream *cs, int event_type, struct wait_event *es)
static int mux_pt_subscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
struct connection *conn = __cs_conn(cs);
@ -576,7 +576,7 @@ static int mux_pt_subscribe(struct conn_stream *cs, int event_type, struct wait_
* The <es> pointer is not allowed to differ from the one passed to the
* subscribe() call. It always returns zero.
*/
static int mux_pt_unsubscribe(struct conn_stream *cs, int event_type, struct wait_event *es)
static int mux_pt_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
struct connection *conn = __cs_conn(cs);
@ -586,7 +586,7 @@ static int mux_pt_unsubscribe(struct conn_stream *cs, int event_type, struct wai
#if defined(USE_LINUX_SPLICE)
/* Send and get, using splicing */
static int mux_pt_rcv_pipe(struct conn_stream *cs, struct pipe *pipe, unsigned int count)
static int mux_pt_rcv_pipe(struct stconn *cs, struct pipe *pipe, unsigned int count)
{
struct connection *conn = __cs_conn(cs);
struct mux_pt_ctx *ctx = conn->ctx;
@ -608,7 +608,7 @@ static int mux_pt_rcv_pipe(struct conn_stream *cs, struct pipe *pipe, unsigned i
return (ret);
}
static int mux_pt_snd_pipe(struct conn_stream *cs, struct pipe *pipe)
static int mux_pt_snd_pipe(struct stconn *cs, struct pipe *pipe)
{
struct connection *conn = __cs_conn(cs);
struct mux_pt_ctx *ctx = conn->ctx;

View File

@ -1455,7 +1455,7 @@ static void qc_detach(struct sedesc *endp)
}
/* Called from the upper layer, to receive data */
static size_t qc_rcv_buf(struct conn_stream *cs, struct buffer *buf,
static size_t qc_rcv_buf(struct stconn *cs, struct buffer *buf,
size_t count, int flags)
{
struct qcs *qcs = __cs_mux(cs);
@ -1525,7 +1525,7 @@ static size_t qc_rcv_buf(struct conn_stream *cs, struct buffer *buf,
return ret;
}
static size_t qc_snd_buf(struct conn_stream *cs, struct buffer *buf,
static size_t qc_snd_buf(struct stconn *cs, struct buffer *buf,
size_t count, int flags)
{
struct qcs *qcs = __cs_mux(cs);
@ -1545,7 +1545,7 @@ static size_t qc_snd_buf(struct conn_stream *cs, struct buffer *buf,
* as at least one event is still subscribed. The <event_type> must only be a
* combination of SUB_RETRY_RECV and SUB_RETRY_SEND. It always returns 0.
*/
static int qc_subscribe(struct conn_stream *cs, int event_type,
static int qc_subscribe(struct stconn *cs, int event_type,
struct wait_event *es)
{
return qcs_subscribe(__cs_mux(cs), event_type, es);
@ -1555,7 +1555,7 @@ static int qc_subscribe(struct conn_stream *cs, int event_type,
* The <es> pointer is not allowed to differ from the one passed to the
* subscribe() call. It always returns zero.
*/
static int qc_unsubscribe(struct conn_stream *cs, int event_type, struct wait_event *es)
static int qc_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
struct qcs *qcs = __cs_mux(cs);
@ -1570,8 +1570,8 @@ static int qc_unsubscribe(struct conn_stream *cs, int event_type, struct wait_ev
}
/* Loop through all qcs from <qcc>. If CO_FL_ERROR is set on the connection,
* report SE_FL_ERR_PENDING|SE_FL_ERROR on the attached conn-streams and wake
* them.
* report SE_FL_ERR_PENDING|SE_FL_ERROR on the attached stream connectors and
* wake them.
*/
static int qc_wake_some_streams(struct qcc *qcc)
{

View File

@ -509,7 +509,7 @@ void mworker_cleanup_proc()
/* Displays workers and processes */
static int cli_io_handler_show_proc(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct mworker_proc *child;
int old = 0;
int up = now.tv_sec - proc_self->timestamp;

View File

@ -1167,7 +1167,7 @@ static int peer_get_version(const char *str,
*/
static inline int peer_getline(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
int n;
n = co_getline(cs_oc(cs), trash.area, trash.size);
@ -1201,7 +1201,7 @@ static inline int peer_send_msg(struct appctx *appctx,
struct peer_prep_params *params)
{
int ret, msglen;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
msglen = peer_prepare_msg(trash.area, trash.size, params);
if (!msglen) {
@ -1681,7 +1681,7 @@ static inline int peer_send_teach_stage2_msgs(struct appctx *appctx, struct peer
static int peer_treat_updatemsg(struct appctx *appctx, struct peer *p, int updt, int exp,
char **msg_cur, char *msg_end, int msg_len, int totl)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct shared_table *st = p->remote_table;
struct stksess *ts, *newts;
uint32_t update;
@ -2133,7 +2133,7 @@ static inline int peer_treat_switchmsg(struct appctx *appctx, struct peer *p,
static inline int peer_treat_definemsg(struct appctx *appctx, struct peer *p,
char **msg_cur, char *msg_end, int totl)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
int table_id_len;
struct shared_table *st;
int table_type;
@ -2332,7 +2332,7 @@ static inline int peer_recv_msg(struct appctx *appctx, char *msg_head, size_t ms
uint32_t *msg_len, int *totl)
{
int reql;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
char *cur;
reql = co_getblk(cs_oc(cs), msg_head, 2 * sizeof(char), *totl);
@ -2850,7 +2850,7 @@ static inline void init_connected_peer(struct peer *peer, struct peers *peers)
*/
static void peer_io_handler(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct stream *s = __cs_strm(cs);
struct peers *curpeers = strm_fe(s)->parent;
struct peer *curpeer = NULL;
@ -3744,7 +3744,7 @@ static int cli_parse_show_peers(char **args, char *payload, struct appctx *appct
* Returns 0 if the output buffer is full and needs to be called again, non-zero if not.
* Dedicated to be called by cli_io_handler_show_peers() cli I/O handler.
*/
static int peers_dump_head(struct buffer *msg, struct conn_stream *cs, struct peers *peers)
static int peers_dump_head(struct buffer *msg, struct stconn *cs, struct peers *peers)
{
struct tm tm;
@ -3773,11 +3773,11 @@ static int peers_dump_head(struct buffer *msg, struct conn_stream *cs, struct pe
* Returns 0 if the output buffer is full and needs to be called again, non-zero
* if not. Dedicated to be called by cli_io_handler_show_peers() cli I/O handler.
*/
static int peers_dump_peer(struct buffer *msg, struct conn_stream *cs, struct peer *peer, int flags)
static int peers_dump_peer(struct buffer *msg, struct stconn *cs, struct peer *peer, int flags)
{
struct connection *conn;
char pn[INET6_ADDRSTRLEN];
struct conn_stream *peer_cs;
struct stconn *peer_cs;
struct stream *peer_s;
struct appctx *appctx;
struct shared_table *st;

View File

@ -1005,13 +1005,13 @@ int pool_parse_debugging(const char *str, char **err)
return 1;
}
/* This function dumps memory usage information onto the conn-stream's
/* This function dumps memory usage information onto the stream connector's
* read buffer. It returns 0 as long as it does not complete, non-zero upon
* completion. No state is used.
*/
static int cli_io_handler_dump_pools(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
dump_pools_to_trash();
if (ci_putchk(cs_ic(cs), &trash) == -1) {

View File

@ -2706,7 +2706,7 @@ static void dump_server_addr(const struct sockaddr_storage *addr, char *addr_str
* ->px, the proxy's id ->only_pxid, the server's pointer from ->sv, and the
* choice of what to dump from ->show_conn.
*/
static int dump_servers_state(struct conn_stream *cs)
static int dump_servers_state(struct stconn *cs)
{
struct appctx *appctx = __cs_appctx(cs);
struct show_srv_ctx *ctx = appctx->svcctx;
@ -2787,7 +2787,7 @@ static int dump_servers_state(struct conn_stream *cs)
static int cli_io_handler_servers_state(struct appctx *appctx)
{
struct show_srv_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct proxy *curproxy;
if (ctx->state == SHOW_SRV_HEAD) {
@ -2828,7 +2828,7 @@ static int cli_io_handler_servers_state(struct appctx *appctx)
*/
static int cli_io_handler_show_backend(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct proxy *curproxy;
chunk_reset(&trash);
@ -3137,14 +3137,14 @@ static int cli_parse_show_errors(char **args, char *payload, struct appctx *appc
return 0;
}
/* This function dumps all captured errors onto the conn-stream's
/* This function dumps all captured errors onto the stream connector's
* read buffer. It returns 0 if the output buffer is full and it needs
* to be called again, otherwise non-zero.
*/
static int cli_io_handler_show_errors(struct appctx *appctx)
{
struct show_errors_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
extern const char *monthname[12];
if (unlikely(cs_ic(cs)->flags & (CF_WRITE_ERROR|CF_SHUTW)))

View File

@ -2587,7 +2587,7 @@ static int resolvers_finalize_config(void)
}
static int stats_dump_resolv_to_buffer(struct conn_stream *cs,
static int stats_dump_resolv_to_buffer(struct stconn *cs,
struct dns_nameserver *ns,
struct field *stats, size_t stats_count,
struct list *stat_modules)
@ -2622,7 +2622,7 @@ static int stats_dump_resolv_to_buffer(struct conn_stream *cs,
/* Uses <appctx.ctx.stats.obj1> as a pointer to the current resolver and <obj2>
* as a pointer to the current nameserver.
*/
int stats_dump_resolvers(struct conn_stream *cs,
int stats_dump_resolvers(struct stconn *cs,
struct field *stats, size_t stats_count,
struct list *stat_modules)
{
@ -2757,7 +2757,7 @@ static int cli_parse_stat_resolvers(char **args, char *payload, struct appctx *a
static int cli_io_handler_dump_resolvers_to_buffer(struct appctx *appctx)
{
struct show_resolvers_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct resolvers *resolvers = ctx->resolvers;
struct dns_nameserver *ns;

View File

@ -290,7 +290,7 @@ int ring_attach_cli(struct ring *ring, struct appctx *appctx, uint flags)
int cli_io_handler_show_ring(struct appctx *appctx)
{
struct show_ring_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct ring *ring = ctx->ring;
struct buffer *buf = &ring->buf;
size_t ofs = ctx->ofs;

View File

@ -4315,7 +4315,7 @@ static int cli_parse_set_server(char **args, char *payload, struct appctx *appct
static int cli_parse_get_weight(char **args, char *payload, struct appctx *appctx, void *private)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct proxy *px;
struct server *sv;
char *line;

View File

@ -299,7 +299,7 @@ void sink_setup_proxy(struct proxy *px)
*/
static void sink_forward_io_handler(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct stream *s = __cs_strm(cs);
struct sink *sink = strm_fe(s)->parent;
struct sink_forward_target *sft = appctx->svcctx;
@ -439,7 +439,7 @@ close:
*/
static void sink_forward_oc_io_handler(struct appctx *appctx)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct stream *s = __cs_strm(cs);
struct sink *sink = strm_fe(s)->parent;
struct sink_forward_target *sft = appctx->svcctx;

View File

@ -1319,7 +1319,7 @@ static int cli_io_handler_show_cert(struct appctx *appctx)
struct show_cert_ctx *ctx = appctx->svcctx;
struct buffer *trash = alloc_trash_chunk();
struct ebmb_node *node;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct ckch_store *ckchs;
if (trash == NULL)
@ -1721,7 +1721,7 @@ static int ckch_store_show_ocsp_certid(struct ckch_store *ckch_store, struct buf
static int cli_io_handler_show_cert_detail(struct appctx *appctx)
{
struct show_cert_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct ckch_store *ckchs = ctx->cur_ckchs;
struct buffer *out = alloc_trash_chunk();
int retval = 0;
@ -1772,7 +1772,7 @@ static int cli_io_handler_show_cert_ocsp_detail(struct appctx *appctx)
{
#if ((defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB && !defined OPENSSL_NO_OCSP) && !defined OPENSSL_IS_BORINGSSL)
struct show_cert_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct ckch_store *ckchs = ctx->cur_ckchs;
struct buffer *out = alloc_trash_chunk();
int from_transaction = ctx->transaction;
@ -2053,7 +2053,7 @@ void ckch_store_replace(struct ckch_store *old_ckchs, struct ckch_store *new_ckc
static int cli_io_handler_commit_cert(struct appctx *appctx)
{
struct commit_cert_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
int y = 0;
char *err = NULL;
struct ckch_store *old_ckchs, *new_ckchs = NULL;
@ -2798,7 +2798,7 @@ static inline int __create_new_instance(struct appctx *appctx, struct ckch_inst
static int cli_io_handler_commit_cafile_crlfile(struct appctx *appctx)
{
struct commit_cacrlfile_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
int y = 0;
char *err = NULL;
struct cafile_entry *old_cafile_entry = NULL, *new_cafile_entry = NULL;
@ -3030,7 +3030,7 @@ static void cli_release_commit_cafile(struct appctx *appctx)
static int cli_io_handler_show_cafile_detail(struct appctx *appctx)
{
struct show_cafile_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct cafile_entry *cafile_entry = ctx->cur_cafile_entry;
struct buffer *out = alloc_trash_chunk();
int i = 0;
@ -3201,7 +3201,7 @@ static int cli_io_handler_show_cafile(struct appctx *appctx)
struct show_cafile_ctx *ctx = appctx->svcctx;
struct buffer *trash = alloc_trash_chunk();
struct ebmb_node *node;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct cafile_entry *cafile_entry;
if (trash == NULL)
@ -3717,7 +3717,7 @@ end:
static int cli_io_handler_show_crlfile_detail(struct appctx *appctx)
{
struct show_crlfile_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct cafile_entry *cafile_entry = ctx->cafile_entry;
struct buffer *out = alloc_trash_chunk();
int i;
@ -3852,7 +3852,7 @@ static int cli_io_handler_show_crlfile(struct appctx *appctx)
struct show_crlfile_ctx *ctx = appctx->svcctx;
struct buffer *trash = alloc_trash_chunk();
struct ebmb_node *node;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct cafile_entry *cafile_entry;
if (trash == NULL)

View File

@ -913,7 +913,7 @@ static int cli_io_handler_dump_crtlist(struct appctx *appctx)
{
struct show_crtlist_ctx *ctx = appctx->svcctx;
struct buffer *trash = alloc_trash_chunk();
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct ebmb_node *lnode;
if (trash == NULL)
@ -945,7 +945,7 @@ static int cli_io_handler_dump_crtlist_entries(struct appctx *appctx)
struct show_crtlist_ctx *ctx = appctx->svcctx;
struct buffer *trash = alloc_trash_chunk();
struct crtlist *crtlist;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct crtlist_entry *entry;
if (trash == NULL)
@ -1071,7 +1071,7 @@ static int cli_io_handler_add_crtlist(struct appctx *appctx)
{
struct add_crtlist_ctx *ctx = appctx->svcctx;
struct bind_conf_list *bind_conf_node;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct crtlist *crtlist = ctx->crtlist;
struct crtlist_entry *entry = ctx->entry;
struct ckch_store *store = entry->node.key;

View File

@ -7259,7 +7259,7 @@ struct tls_keys_ref *tlskeys_ref_lookup_ref(const char *reference)
static int cli_io_handler_tlskeys_files(struct appctx *appctx)
{
struct show_keys_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
switch (ctx->state) {
case SHOW_KEYS_INIT:
@ -7538,7 +7538,7 @@ static int cli_io_handler_show_ocspresponse(struct appctx *appctx)
struct buffer *trash = alloc_trash_chunk();
struct buffer *tmp = NULL;
struct ebmb_node *node;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct certificate_ocsp *ocsp = NULL;
BIO *bio = NULL;
int write = -1;
@ -7674,7 +7674,7 @@ static void ssl_provider_clear_name_list(struct list *provider_names)
static int cli_io_handler_show_providers(struct appctx *appctx)
{
struct buffer *trash = get_trash_chunk();
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct list provider_names;
struct provider_name *name;
@ -7805,7 +7805,7 @@ static int cli_io_handler_show_ocspresponse_detail(struct appctx *appctx)
{
struct buffer *trash = alloc_trash_chunk();
struct certificate_ocsp *ocsp = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
if (trash == NULL)
return 1;
@ -7882,7 +7882,7 @@ enum act_return ssl_action_wait_for_hs(struct act_rule *rule, struct proxy *px,
struct session *sess, struct stream *s, int flags)
{
struct connection *conn;
struct conn_stream *cs;
struct stconn *cs;
conn = objt_conn(sess->origin);
cs = s->csf;

View File

@ -309,7 +309,7 @@ int stats_putchk(struct channel *chn, struct htx *htx, struct buffer *chk)
return 1;
}
static const char *stats_scope_ptr(struct appctx *appctx, struct conn_stream *cs)
static const char *stats_scope_ptr(struct appctx *appctx, struct stconn *cs)
{
struct show_stat_ctx *ctx = appctx->svcctx;
struct channel *req = cs_oc(cs);
@ -1809,10 +1809,10 @@ int stats_fill_fe_stats(struct proxy *px, struct field *stats, int len,
}
/* Dumps a frontend's line to the trash for the current proxy <px> and uses
* the state from conn-stream <cs>. The caller is responsible for clearing
* the state from stream connector <cs>. The caller is responsible for clearing
* the trash if needed. Returns non-zero if it emits anything, zero otherwise.
*/
static int stats_dump_fe_stats(struct conn_stream *cs, struct proxy *px)
static int stats_dump_fe_stats(struct stconn *cs, struct proxy *px)
{
struct appctx *appctx = __cs_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
@ -1977,10 +1977,10 @@ int stats_fill_li_stats(struct proxy *px, struct listener *l, int flags,
}
/* Dumps a line for listener <l> and proxy <px> to the trash and uses the state
* from conn-stream <cs>. The caller is responsible for clearing the trash
* from stream connector <cs>. The caller is responsible for clearing the trash
* if needed. Returns non-zero if it emits anything, zero otherwise.
*/
static int stats_dump_li_stats(struct conn_stream *cs, struct proxy *px, struct listener *l)
static int stats_dump_li_stats(struct stconn *cs, struct proxy *px, struct listener *l)
{
struct appctx *appctx = __cs_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
@ -2488,11 +2488,11 @@ int stats_fill_sv_stats(struct proxy *px, struct server *sv, int flags,
}
/* Dumps a line for server <sv> and proxy <px> to the trash and uses the state
* from conn-stream <cs>, and server state <state>. The caller is
* from stream connector <cs>, and server state <state>. The caller is
* responsible for clearing the trash if needed. Returns non-zero if it emits
* anything, zero otherwise.
*/
static int stats_dump_sv_stats(struct conn_stream *cs, struct proxy *px, struct server *sv)
static int stats_dump_sv_stats(struct stconn *cs, struct proxy *px, struct server *sv)
{
struct appctx *appctx = __cs_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
@ -2818,7 +2818,7 @@ int stats_fill_be_stats(struct proxy *px, int flags, struct field *stats, int le
* interface <si>. The caller is responsible for clearing the trash if needed.
* Returns non-zero if it emits anything, zero otherwise.
*/
static int stats_dump_be_stats(struct conn_stream *cs, struct proxy *px)
static int stats_dump_be_stats(struct stconn *cs, struct proxy *px)
{
struct appctx *appctx = __cs_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
@ -2857,10 +2857,10 @@ static int stats_dump_be_stats(struct conn_stream *cs, struct proxy *px)
}
/* Dumps the HTML table header for proxy <px> to the trash for and uses the state from
* conn-stream <cs> and per-uri parameters <uri>. The caller is responsible
* stream connector <cs> and per-uri parameters <uri>. The caller is responsible
* for clearing the trash if needed.
*/
static void stats_dump_html_px_hdr(struct conn_stream *cs, struct proxy *px)
static void stats_dump_html_px_hdr(struct stconn *cs, struct proxy *px)
{
struct appctx *appctx = __cs_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
@ -2968,9 +2968,9 @@ static void stats_dump_html_px_hdr(struct conn_stream *cs, struct proxy *px)
}
/* Dumps the HTML table trailer for proxy <px> to the trash for and uses the state from
* conn_stream <cs>. The caller is responsible for clearing the trash if needed.
* stream connector <cs>. The caller is responsible for clearing the trash if needed.
*/
static void stats_dump_html_px_end(struct conn_stream *cs, struct proxy *px)
static void stats_dump_html_px_end(struct stconn *cs, struct proxy *px)
{
struct appctx *appctx = __cs_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
@ -3007,13 +3007,13 @@ static void stats_dump_html_px_end(struct conn_stream *cs, struct proxy *px)
}
/*
* Dumps statistics for a proxy. The output is sent to the conn-stream's
* Dumps statistics for a proxy. The output is sent to the stream connector's
* input buffer. Returns 0 if it had to stop dumping data because of lack of
* buffer space, or non-zero if everything completed. This function is used
* both by the CLI and the HTTP entry points, and is able to dump the output
* in HTML or CSV formats. If the later, <uri> must be NULL.
*/
int stats_dump_proxy_to_buffer(struct conn_stream *cs, struct htx *htx,
int stats_dump_proxy_to_buffer(struct stconn *cs, struct htx *htx,
struct proxy *px, struct uri_auth *uri)
{
struct appctx *appctx = __cs_appctx(cs);
@ -3389,10 +3389,10 @@ static void stats_dump_html_head(struct appctx *appctx, struct uri_auth *uri)
}
/* Dumps the HTML stats information block to the trash for and uses the state from
* conn-stream <cs> and per-uri parameters <uri>. The caller is responsible
* stream connector <cs> and per-uri parameters <uri>. The caller is responsible
* for clearing the trash if needed.
*/
static void stats_dump_html_info(struct conn_stream *cs, struct uri_auth *uri)
static void stats_dump_html_info(struct stconn *cs, struct uri_auth *uri)
{
struct appctx *appctx = __cs_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
@ -3673,7 +3673,7 @@ static void stats_dump_json_end()
/* Uses <appctx.ctx.stats.obj1> as a pointer to the current proxy and <obj2> as
* a pointer to the current server/listener.
*/
static int stats_dump_proxies(struct conn_stream *cs,
static int stats_dump_proxies(struct stconn *cs,
struct htx *htx,
struct uri_auth *uri)
{
@ -3715,14 +3715,14 @@ static int stats_dump_proxies(struct conn_stream *cs,
return 0;
}
/* This function dumps statistics onto the conn-stream's read buffer in
/* This function dumps statistics onto the stream connector's read buffer in
* either CSV or HTML format. <uri> contains some HTML-specific parameters that
* are ignored for CSV format (hence <uri> may be NULL there). It returns 0 if
* it had to stop writing data and an I/O is needed, 1 if the dump is finished
* and the stream must be closed, or -1 in case of any error. This function is
* used by both the CLI and the HTTP handlers.
*/
static int stats_dump_stat_to_buffer(struct conn_stream *cs, struct htx *htx,
static int stats_dump_stat_to_buffer(struct stconn *cs, struct htx *htx,
struct uri_auth *uri)
{
struct appctx *appctx = __cs_appctx(cs);
@ -3825,7 +3825,7 @@ static int stats_dump_stat_to_buffer(struct conn_stream *cs, struct htx *htx,
* Parse the posted data and enable/disable servers if necessary.
* Returns 1 if request was parsed or zero if it needs more data.
*/
static int stats_process_http_post(struct conn_stream *cs)
static int stats_process_http_post(struct stconn *cs)
{
struct stream *s = __cs_strm(cs);
struct appctx *appctx = __cs_appctx(cs);
@ -4161,7 +4161,7 @@ static int stats_process_http_post(struct conn_stream *cs)
}
static int stats_send_http_headers(struct conn_stream *cs, struct htx *htx)
static int stats_send_http_headers(struct stconn *cs, struct htx *htx)
{
struct stream *s = __cs_strm(cs);
struct uri_auth *uri = s->be->uri_auth;
@ -4215,7 +4215,7 @@ static int stats_send_http_headers(struct conn_stream *cs, struct htx *htx)
}
static int stats_send_http_redirect(struct conn_stream *cs, struct htx *htx)
static int stats_send_http_redirect(struct stconn *cs, struct htx *htx)
{
char scope_txt[STAT_SCOPE_TXT_MAXLEN + sizeof STAT_SCOPE_PATTERN];
struct stream *s = __cs_strm(cs);
@ -4275,7 +4275,7 @@ full:
}
/* This I/O handler runs as an applet embedded in a conn-stream. It is
/* This I/O handler runs as an applet embedded in a stream connector. It is
* used to send HTTP stats over a TCP socket. The mechanism is very simple.
* appctx->st0 contains the operation in progress (dump, done). The handler
* automatically unregisters itself once transfer is complete.
@ -4283,7 +4283,7 @@ full:
static void http_stats_io_handler(struct appctx *appctx)
{
struct show_stat_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct stream *s = __cs_strm(cs);
struct channel *req = cs_oc(cs);
struct channel *res = cs_ic(cs);
@ -4544,11 +4544,11 @@ int stats_fill_info(struct field *info, int len, uint flags)
return 1;
}
/* This function dumps information onto the conn-stream's read buffer.
/* This function dumps information onto the stream connector's read buffer.
* It returns 0 as long as it does not complete, non-zero upon completion.
* No state is used.
*/
static int stats_dump_info_to_buffer(struct conn_stream *cs)
static int stats_dump_info_to_buffer(struct stconn *cs)
{
struct appctx *appctx = __cs_appctx(cs);
struct show_stat_ctx *ctx = appctx->svcctx;
@ -4573,7 +4573,7 @@ static int stats_dump_info_to_buffer(struct conn_stream *cs)
return 1;
}
/* This function dumps the schema onto the conn-stream's read buffer.
/* This function dumps the schema onto the stream connector's read buffer.
* It returns 0 as long as it does not complete, non-zero upon completion.
* No state is used.
*
@ -4783,11 +4783,11 @@ static void stats_dump_json_schema(struct buffer *out)
}
}
/* This function dumps the schema onto the conn-stream's read buffer.
/* This function dumps the schema onto the stream connector's read buffer.
* It returns 0 as long as it does not complete, non-zero upon completion.
* No state is used.
*/
static int stats_dump_json_schema_to_buffer(struct conn_stream *cs)
static int stats_dump_json_schema_to_buffer(struct stconn *cs)
{
chunk_reset(&trash);
@ -5007,7 +5007,7 @@ static int cli_io_handler_dump_info(struct appctx *appctx)
return stats_dump_info_to_buffer(appctx_cs(appctx));
}
/* This I/O handler runs as an applet embedded in a conn-stream. It is
/* This I/O handler runs as an applet embedded in a stream connector. It is
* used to send raw stats over a socket.
*/
static int cli_io_handler_dump_stat(struct appctx *appctx)

View File

@ -4234,12 +4234,12 @@ enum {
STK_CLI_ACT_SHOW,
};
/* Dump the status of a table to a conn-stream's
/* Dump the status of a table to a stream connector's
* read buffer. It returns 0 if the output buffer is full
* and needs to be called again, otherwise non-zero.
*/
static int table_dump_head_to_buffer(struct buffer *msg,
struct conn_stream *cs,
struct stconn *cs,
struct stktable *t, struct stktable *target)
{
struct stream *s = __cs_strm(cs);
@ -4260,12 +4260,12 @@ static int table_dump_head_to_buffer(struct buffer *msg,
return 1;
}
/* Dump a table entry to a conn-stream's
/* Dump a table entry to a stream connector's
* read buffer. It returns 0 if the output buffer is full
* and needs to be called again, otherwise non-zero.
*/
static int table_dump_entry_to_buffer(struct buffer *msg,
struct conn_stream *cs,
struct stconn *cs,
struct stktable *t, struct stksess *entry)
{
int dt;
@ -4408,7 +4408,7 @@ struct show_table_ctx {
*/
static int table_process_entry_per_key(struct appctx *appctx, char **args)
{
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct show_table_ctx *ctx = appctx->svcctx;
struct stktable *t = ctx->target;
struct stksess *ts;
@ -4668,7 +4668,7 @@ err_args:
static int cli_io_handler_table(struct appctx *appctx)
{
struct show_table_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct stream *s = __cs_strm(cs);
struct ebmb_node *eb;
int skip_entry;

View File

@ -79,7 +79,7 @@ static void strm_trace(enum trace_level level, uint64_t mask,
/* The event representation is split like this :
* strm - stream
* cs - conn-stream
* cs - stream connector
* http - http analyzis
* tcp - tcp analyzis
*
@ -92,7 +92,7 @@ static const struct trace_event strm_trace_events[] = {
{ .mask = STRM_EV_STRM_ANA, .name = "strm_ana", .desc = "stream analyzers" },
{ .mask = STRM_EV_STRM_PROC, .name = "strm_proc", .desc = "stream processing" },
{ .mask = STRM_EV_CS_ST, .name = "cs_state", .desc = "processing conn-stream states" },
{ .mask = STRM_EV_CS_ST, .name = "cs_state", .desc = "processing connector states" },
{ .mask = STRM_EV_HTTP_ANA, .name = "http_ana", .desc = "HTTP analyzers" },
{ .mask = STRM_EV_HTTP_ERR, .name = "http_err", .desc = "error during HTTP analyzis" },
@ -116,7 +116,7 @@ static const struct name_desc strm_trace_decoding[] = {
#define STRM_VERB_CLEAN 1
{ .name="clean", .desc="only user-friendly stuff, generally suitable for level \"user\"" },
#define STRM_VERB_MINIMAL 2
{ .name="minimal", .desc="report info on stream and conn-streams" },
{ .name="minimal", .desc="report info on streams and connectors" },
#define STRM_VERB_SIMPLE 3
{ .name="simple", .desc="add info on request and response channels" },
#define STRM_VERB_ADVANCED 4
@ -171,7 +171,7 @@ static void strm_trace(enum trace_level level, uint64_t mask, const struct trace
b_putist(&trace_buf, s->unique_id);
}
/* Front and back conn-stream state */
/* Front and back stream connector state */
chunk_appendf(&trace_buf, " CS=(%s,%s)",
cs_state_str(s->csf->state), cs_state_str(s->csb->state));
@ -268,14 +268,14 @@ static void strm_trace(enum trace_level level, uint64_t mask, const struct trace
}
}
/* Upgrade an existing stream for conn-stream <cs>. Return < 0 on error. This
/* Upgrade an existing stream for stream connector <cs>. Return < 0 on error. This
* is only valid right after a TCP to H1 upgrade. The stream should be
* "reativated" by removing SF_IGNORE flag. And the right mode must be set. On
* success, <input> buffer is transferred to the stream and thus points to
* BUF_NULL. On error, it is unchanged and it is the caller responsibility to
* release it (this never happens for now).
*/
int stream_upgrade_from_cs(struct conn_stream *cs, struct buffer *input)
int stream_upgrade_from_cs(struct stconn *cs, struct buffer *input)
{
struct stream *s = __cs_strm(cs);
const struct mux_ops *mux = cs_conn_mux(cs);
@ -303,7 +303,7 @@ int stream_upgrade_from_cs(struct conn_stream *cs, struct buffer *input)
}
/* Callback used to wake up a stream when an input buffer is available. The
* stream <s>'s conn-streams are checked for a failed buffer allocation
* stream <s>'s stream connectors are checked for a failed buffer allocation
* as indicated by the presence of the SE_FL_RXBLK_ROOM flag and the lack of a
* buffer, and and input buffer is assigned there (at most one). The function
* returns 1 and wakes the stream up if a buffer was taken, otherwise zero.
@ -339,7 +339,7 @@ int stream_buf_available(void *arg)
* transfer to the stream and <input> is set to BUF_NULL. On error, <input>
* buffer is unchanged and it is the caller responsibility to release it.
*/
struct stream *stream_new(struct session *sess, struct conn_stream *cs, struct buffer *input)
struct stream *stream_new(struct session *sess, struct stconn *cs, struct buffer *input)
{
struct stream *s;
struct task *t;
@ -1462,7 +1462,7 @@ static int process_store_rules(struct stream *s, struct channel *rep, int an_bit
*/
int stream_set_http_mode(struct stream *s, const struct mux_proto_list *mux_proto)
{
struct conn_stream *cs = s->csf;
struct stconn *cs = s->csf;
struct connection *conn;
/* Already an HTTP stream */
@ -1495,7 +1495,7 @@ int stream_set_http_mode(struct stream *s, const struct mux_proto_list *mux_prot
s->req.total = 0;
s->flags |= SF_IGNORE;
if (strcmp(conn->mux->name, "H2") == 0) {
/* For HTTP/2, destroy the conn_stream, disable logging,
/* For HTTP/2, destroy the stream connector, disable logging,
* and abort the stream process. Thus it will be
* silently destroyed. The new mux will create new
* streams.
@ -1513,17 +1513,17 @@ int stream_set_http_mode(struct stream *s, const struct mux_proto_list *mux_prot
}
/* Updates at once the channel flags, and timers of both conn-streams of a
/* Updates at once the channel flags, and timers of both stream connectors of a
* same stream, to complete the work after the analysers, then updates the data
* layer below. This will ensure that any synchronous update performed at the
* data layer will be reflected in the channel flags and/or conn-stream.
* Note that this does not change the conn-stream's current state, though
* data layer will be reflected in the channel flags and/or stream connector.
* Note that this does not change the stream connector's current state, though
* it updates the previous state to the current one.
*/
static void stream_update_both_cs(struct stream *s)
{
struct conn_stream *csf = s->csf;
struct conn_stream *csb = s->csb;
struct stconn *csf = s->csf;
struct stconn *csb = s->csb;
struct channel *req = &s->req;
struct channel *res = &s->res;
@ -1539,7 +1539,7 @@ static void stream_update_both_cs(struct stream *s)
if (cs_state_in(csb->state, CS_SB_RDY|CS_SB_EST))
cs_update(csb);
/* conn-streams are processed outside of process_stream() and must be
/* stream connectors are processed outside of process_stream() and must be
* handled at the latest moment.
*/
if (cs_appctx(csf)) {
@ -1620,7 +1620,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
unsigned int rp_cons_last, rp_prod_last;
unsigned int req_ana_back;
struct channel *req, *res;
struct conn_stream *csf, *csb;
struct stconn *csf, *csb;
unsigned int rate;
DBG_TRACE_ENTER(STRM_EV_STRM_PROC, s);
@ -1659,7 +1659,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
rqf_last = req->flags & ~CF_MASK_ANALYSER;
rpf_last = res->flags & ~CF_MASK_ANALYSER;
/* we don't want the conn-stream functions to recursively wake us up */
/* we don't want the stream connector functions to recursively wake us up */
csf->flags |= CS_FL_DONT_WAKE;
csb->flags |= CS_FL_DONT_WAKE;
@ -1667,12 +1667,12 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
s->pending_events |= (state & TASK_WOKEN_ANY);
/* 1a: Check for low level timeouts if needed. We just set a flag on
* conn-streams when their timeouts have expired.
* stream connectors when their timeouts have expired.
*/
if (unlikely(s->pending_events & TASK_WOKEN_TIMER)) {
stream_check_conn_timeout(s);
/* check channel timeouts, and close the corresponding conn-streams
/* check channel timeouts, and close the corresponding stream connectors
* for future reads or writes. Note: this will also concern upper layers
* but we do not touch any other flag. We must be careful and correctly
* detect state changes when calling them.
@ -1724,7 +1724,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
}
}
resync_conn_stream:
resync_stconns:
/* below we may emit error messages so we have to ensure that we have
* our buffers properly allocated. If the allocation failed, an error is
* triggered.
@ -1746,7 +1746,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
sess_set_term_flags(s);
}
/* 1b: check for low-level errors reported at the conn-stream.
/* 1b: check for low-level errors reported at the stream connector.
* First we check if it's a retryable error (in which case we don't
* want to tell the buffer). Otherwise we report the error one level
* upper by setting flags into the buffers. Note that the side towards
@ -2105,7 +2105,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
sess_set_term_flags(s);
/* Abort the request if a client error occurred while
* the backend conn-stream is in the CS_ST_INI
* the backend stream connector is in the CS_ST_INI
* state. It is switched into the CS_ST_CLO state and
* the request channel is erased. */
if (csb->state == CS_ST_INI) {
@ -2271,7 +2271,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
/* get a chance to complete an immediate connection setup */
if (csb->state == CS_ST_RDY)
goto resync_conn_stream;
goto resync_stconns;
/* applets directly go to the ESTABLISHED state. Similarly,
* servers experience the same fate when their connection
@ -2330,7 +2330,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
cs_state_in(csb->state, CS_SB_RDY|CS_SB_DIS) ||
(sc_ep_test(csf, SE_FL_ERROR) && csf->state != CS_ST_CLO) ||
(sc_ep_test(csb, SE_FL_ERROR) && csb->state != CS_ST_CLO))
goto resync_conn_stream;
goto resync_stconns;
/* otherwise we want to check if we need to resync the req buffer or not */
if ((req->flags ^ rqf_last) & (CF_SHUTR|CF_SHUTW))
@ -2454,7 +2454,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
cs_state_in(csb->state, CS_SB_RDY|CS_SB_DIS) ||
(sc_ep_test(csf, SE_FL_ERROR) && csf->state != CS_ST_CLO) ||
(sc_ep_test(csb, SE_FL_ERROR) && csb->state != CS_ST_CLO))
goto resync_conn_stream;
goto resync_stconns;
if ((req->flags & ~rqf_last) & CF_MASK_ANALYSER)
goto resync_request;
@ -2664,9 +2664,9 @@ void sess_change_server(struct stream *strm, struct server *newsrv)
/* Handle server-side errors for default protocols. It is called whenever a a
* connection setup is aborted or a request is aborted in queue. It sets the
* stream termination flags so that the caller does not have to worry about
* them. It's installed as ->srv_error for the server-side conn_stream.
* them. It's installed as ->srv_error for the server-side stream connector.
*/
void default_srv_error(struct stream *s, struct conn_stream *cs)
void default_srv_error(struct stream *s, struct stconn *cs)
{
int err_type = s->conn_err_type;
int err = 0, fin = 0;
@ -2730,7 +2730,7 @@ void stream_shutdown(struct stream *stream, int why)
*/
void stream_dump(struct buffer *buf, const struct stream *s, const char *pfx, char eol)
{
const struct conn_stream *csf, *csb;
const struct stconn *csf, *csb;
const struct connection *cof, *cob;
const struct appctx *acf, *acb;
const struct server *srv;
@ -3145,16 +3145,16 @@ struct show_sess_ctx {
int pos; /* last position of the current session's buffer */
};
/* This function dumps a complete stream state onto the conn-stream's
/* This function dumps a complete stream state onto the stream connector's
* read buffer. The stream has to be set in strm. It returns 0 if the output
* buffer is full and it needs to be called again, otherwise non-zero. It is
* designed to be called from stats_dump_strm_to_buffer() below.
*/
static int stats_dump_full_strm_to_buffer(struct conn_stream *cs, struct stream *strm)
static int stats_dump_full_strm_to_buffer(struct stconn *cs, struct stream *strm)
{
struct appctx *appctx = __cs_appctx(cs);
struct show_sess_ctx *ctx = appctx->svcctx;
struct conn_stream *csf, *csb;
struct stconn *csf, *csb;
struct tm tm;
extern const char *monthname[12];
char pn[INET6_ADDRSTRLEN];
@ -3518,7 +3518,7 @@ static int cli_parse_show_sess(char **args, char *payload, struct appctx *appctx
return 0;
}
/* This function dumps all streams' states onto the conn-stream's
/* This function dumps all streams' states onto the stream connector's
* read buffer. It returns 0 if the output buffer is full and it needs
* to be called again, otherwise non-zero. It proceeds in an isolated
* thread so there is no thread safety issue here.
@ -3526,7 +3526,7 @@ static int cli_parse_show_sess(char **args, char *payload, struct appctx *appctx
static int cli_io_handler_dump_sess(struct appctx *appctx)
{
struct show_sess_ctx *ctx = appctx->svcctx;
struct conn_stream *cs = appctx_cs(appctx);
struct stconn *cs = appctx_cs(appctx);
struct connection *conn;
thread_isolate();

View File

@ -472,7 +472,7 @@ resume_execution:
/* This function performs the TCP layer4 analysis on the current request. It
* returns 0 if a reject rule matches, otherwise 1 if either an accept rule
* matches or if no more rule matches. It can only use rules which don't need
* any data. This only works on connection-based client-facing conn-streams.
* any data. This only works on connection-based client-facing stream connectors.
*/
int tcp_exec_l4_rules(struct session *sess)
{
@ -569,7 +569,7 @@ int tcp_exec_l4_rules(struct session *sess)
/* This function performs the TCP layer5 analysis on the current request. It
* returns 0 if a reject rule matches, otherwise 1 if either an accept rule
* matches or if no more rule matches. It can only use rules which don't need
* any data. This only works on session-based client-facing conn-streams.
* any data. This only works on session-based client-facing stream connectors.
* An example of valid use case is to track a stick-counter on the source
* address extracted from the proxy protocol.
*/

View File

@ -321,9 +321,10 @@ static inline int get_tcp_info(const struct arg *args, struct sample *smp,
if (!smp->strm)
return 0;
/* get the object associated with the conn-stream.The
/* get the object associated with the stream connector.The
* object can be other thing than a connection. For example,
* it be a appctx. */
* it be a appctx.
*/
conn = (dir == 0 ? cs_conn(smp->strm->csf) : cs_conn(smp->strm->csb));
if (!conn)
return 0;

View File

@ -1097,7 +1097,7 @@ enum tcpcheck_eval_ret tcpcheck_eval_connect(struct check *check, struct tcpchec
chunk_appendf(&trash, " comment: '%s'", rule->comment);
set_server_check_status(check, HCHK_STATUS_SOCKERR, trash.area);
ret = TCPCHK_EVAL_STOP;
TRACE_ERROR("conn-stream allocation error", CHK_EV_TCPCHK_CONN|CHK_EV_TCPCHK_ERR, check);
TRACE_ERROR("stconn allocation error", CHK_EV_TCPCHK_CONN|CHK_EV_TCPCHK_ERR, check);
goto out;
}
if (cs_attach_mux(check->cs, NULL, conn) < 0) {
@ -1324,7 +1324,7 @@ enum tcpcheck_eval_ret tcpcheck_eval_send(struct check *check, struct tcpcheck_r
{
enum tcpcheck_eval_ret ret = TCPCHK_EVAL_CONTINUE;
struct tcpcheck_send *send = &rule->send;
struct conn_stream *cs = check->cs;
struct stconn *cs = check->cs;
struct connection *conn = __cs_conn(cs);
struct buffer *tmp = NULL;
struct htx *htx = NULL;
@ -1534,7 +1534,7 @@ enum tcpcheck_eval_ret tcpcheck_eval_send(struct check *check, struct tcpcheck_r
*/
enum tcpcheck_eval_ret tcpcheck_eval_recv(struct check *check, struct tcpcheck_rule *rule)
{
struct conn_stream *cs = check->cs;
struct stconn *cs = check->cs;
struct connection *conn = __cs_conn(cs);
enum tcpcheck_eval_ret ret = TCPCHK_EVAL_CONTINUE;
size_t max, read, cur_read = 0;
@ -1562,7 +1562,7 @@ enum tcpcheck_eval_ret tcpcheck_eval_recv(struct check *check, struct tcpcheck_r
goto wait_more_data;
}
/* errors on the connection and the conn-stream were already checked */
/* errors on the connection and the stream connector were already checked */
/* prepare to detect if the mux needs more room */
sc_ep_clr(cs, SE_FL_WANT_ROOM);
@ -2125,7 +2125,7 @@ enum tcpcheck_eval_ret tcpcheck_eval_action_kw(struct check *check, struct tcpch
int tcpcheck_main(struct check *check)
{
struct tcpcheck_rule *rule;
struct conn_stream *cs = check->cs;
struct stconn *cs = check->cs;
struct connection *conn = cs_conn(cs);
int must_read = 1, last_read = 0;
int retcode = 0;
@ -2137,9 +2137,9 @@ int tcpcheck_main(struct check *check)
TRACE_ENTER(CHK_EV_TCPCHK_EVAL, check);
/* Note: the conn-stream and the connection may only be undefined before
/* Note: the stream connector and the connection may only be undefined before
* the first rule evaluation (it is always a connect rule) or when the
* conn-stream allocation failed on a connect rule, during cs allocation.
* stream connector allocation failed on a connect rule, during cs allocation.
*/
/* 1- check for connection error, if any */