return (conn ? conn->mux : NULL);
}
-/* Returns the mux from a cs if the endpoint is a mux. Otherwise
- * NULL is returned. __cs_mux() returns the mux without any control
- * while cs_mux() check the endpoint type.
+/* Returns a pointer to the mux stream from a connector if the endpoint is
+ * a mux. Otherwise NULL is returned. __sc_mux_strm() returns the mux without
+ * any control while sc_mux_strm() checks the endpoint type.
*/
-static inline void *__cs_mux(const struct stconn *cs)
+static inline void *__sc_mux_strm(const struct stconn *cs)
{
return __cs_endp_target(cs);
}
-static inline struct appctx *cs_mux(const struct stconn *cs)
+static inline struct appctx *sc_mux_strm(const struct stconn *cs)
{
if (sc_ep_test(cs, SE_FL_T_MUX))
- return __cs_mux(cs);
+ return __sc_mux_strm(cs);
return NULL;
}
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);
+ struct qcs *qcs = __sc_mux_strm(cs);
struct htx *htx;
enum htx_blk_type btype;
struct htx_blk *blk;
static size_t hq_interop_snd_buf(struct stconn *cs, struct buffer *buf,
size_t count, int flags)
{
- struct qcs *qcs = __cs_mux(cs);
+ struct qcs *qcs = __sc_mux_strm(cs);
struct htx *htx;
enum htx_blk_type btype;
struct htx_blk *blk;
/* 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);
+ struct fcgi_strm *fstrm = __sc_mux_strm(cs);
TRACE_POINT(FCGI_EV_STRM_SHUT, fstrm->fconn->conn, fstrm);
if (!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);
+ struct fcgi_strm *fstrm = __sc_mux_strm(cs);
TRACE_POINT(FCGI_EV_STRM_SHUT, fstrm->fconn->conn, fstrm);
fcgi_do_shutw(fstrm);
*/
static int fcgi_subscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
- struct fcgi_strm *fstrm = __cs_mux(cs);
+ struct fcgi_strm *fstrm = __sc_mux_strm(cs);
struct fcgi_conn *fconn = fstrm->fconn;
BUG_ON(event_type & ~(SUB_RETRY_SEND|SUB_RETRY_RECV));
*/
static int fcgi_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
- struct fcgi_strm *fstrm = __cs_mux(cs);
+ struct fcgi_strm *fstrm = __sc_mux_strm(cs);
struct fcgi_conn *fconn = fstrm->fconn;
BUG_ON(event_type & ~(SUB_RETRY_SEND|SUB_RETRY_RECV));
*/
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_strm *fstrm = __sc_mux_strm(cs);
struct fcgi_conn *fconn = fstrm->fconn;
size_t ret = 0;
*/
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_strm *fstrm = __sc_mux_strm(cs);
struct fcgi_conn *fconn = fstrm->fconn;
size_t total = 0;
size_t ret;
static void h1_shutr(struct stconn *cs, enum co_shr_mode mode)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
struct h1c *h1c;
if (!h1s)
static void h1_shutw(struct stconn *cs, enum co_shw_mode mode)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
struct h1c *h1c;
if (!h1s)
*/
static int h1_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
if (!h1s)
return 0;
*/
static int h1_subscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
struct h1c *h1c;
if (!h1s)
*/
static size_t h1_rcv_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
struct h1c *h1c = h1s->h1c;
struct h1m *h1m = (!(h1c->flags & H1C_F_IS_BACK) ? &h1s->req : &h1s->res);
size_t ret = 0;
/* Called from the upper layer, to send data */
static size_t h1_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
struct h1c *h1c;
size_t total = 0;
/* Send and get, using splicing */
static int h1_rcv_pipe(struct stconn *cs, struct pipe *pipe, unsigned int count)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
struct h1c *h1c = h1s->h1c;
struct h1m *h1m = (!(h1c->flags & H1C_F_IS_BACK) ? &h1s->req : &h1s->res);
int ret = 0;
static int h1_snd_pipe(struct stconn *cs, struct pipe *pipe)
{
- struct h1s *h1s = __cs_mux(cs);
+ struct h1s *h1s = __sc_mux_strm(cs);
struct h1c *h1c = h1s->h1c;
struct h1m *h1m = (!(h1c->flags & H1C_F_IS_BACK) ? &h1s->res : &h1s->req);
int ret = 0;
/* 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);
+ struct h2s *h2s = __sc_mux_strm(cs);
TRACE_ENTER(H2_EV_STRM_SHUT, h2s->h2c->conn, h2s);
if (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);
+ struct h2s *h2s = __sc_mux_strm(cs);
TRACE_ENTER(H2_EV_STRM_SHUT, h2s->h2c->conn, h2s);
h2_do_shutw(h2s);
*/
static int h2_subscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
- struct h2s *h2s = __cs_mux(cs);
+ struct h2s *h2s = __sc_mux_strm(cs);
struct h2c *h2c = h2s->h2c;
TRACE_ENTER(H2_EV_STRM_SEND|H2_EV_STRM_RECV, h2c->conn, h2s);
*/
static int h2_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
- struct h2s *h2s = __cs_mux(cs);
+ struct h2s *h2s = __sc_mux_strm(cs);
TRACE_ENTER(H2_EV_STRM_SEND|H2_EV_STRM_RECV, h2s->h2c->conn, h2s);
*/
static size_t h2_rcv_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
- struct h2s *h2s = __cs_mux(cs);
+ struct h2s *h2s = __sc_mux_strm(cs);
struct h2c *h2c = h2s->h2c;
struct htx *h2s_htx = NULL;
struct htx *buf_htx = NULL;
*/
static size_t h2_snd_buf(struct stconn *cs, struct buffer *buf, size_t count, int flags)
{
- struct h2s *h2s = __cs_mux(cs);
+ struct h2s *h2s = __sc_mux_strm(cs);
size_t total = 0;
size_t ret;
struct htx *htx;
static size_t qc_rcv_buf(struct stconn *cs, struct buffer *buf,
size_t count, int flags)
{
- struct qcs *qcs = __cs_mux(cs);
+ struct qcs *qcs = __sc_mux_strm(cs);
struct htx *qcs_htx = NULL;
struct htx *cs_htx = NULL;
size_t ret = 0;
static size_t qc_snd_buf(struct stconn *cs, struct buffer *buf,
size_t count, int flags)
{
- struct qcs *qcs = __cs_mux(cs);
+ struct qcs *qcs = __sc_mux_strm(cs);
size_t ret;
TRACE_ENTER(QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs);
static int qc_subscribe(struct stconn *cs, int event_type,
struct wait_event *es)
{
- return qcs_subscribe(__cs_mux(cs), event_type, es);
+ return qcs_subscribe(__sc_mux_strm(cs), event_type, es);
}
/* Called from the upper layer, to unsubscribe <es> from events <event_type>.
*/
static int qc_unsubscribe(struct stconn *cs, int event_type, struct wait_event *es)
{
- struct qcs *qcs = __cs_mux(cs);
+ struct qcs *qcs = __sc_mux_strm(cs);
BUG_ON(event_type & ~(SUB_RETRY_SEND|SUB_RETRY_RECV));
BUG_ON(qcs->subs && qcs->subs != es);