mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 06:41:32 +02:00
CLEANUP: stconn: rename cs_conn_mux() to sc_mux_ops()
This effectively returns the mux_ops from the connection when it exists on an stconn.
This commit is contained in:
parent
6fe2b42e45
commit
417a31bb55
@ -145,10 +145,10 @@ static inline struct connection *sc_conn(const struct stconn *cs)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the mux ops of the connection from a cs if the endpoint is a
|
/* Returns the mux ops of the connection from an stconn if the endpoint is a
|
||||||
* mux stream. Otherwise NULL is returned.
|
* mux stream. Otherwise NULL is returned.
|
||||||
*/
|
*/
|
||||||
static inline const struct mux_ops *cs_conn_mux(const struct stconn *cs)
|
static inline const struct mux_ops *sc_mux_ops(const struct stconn *cs)
|
||||||
{
|
{
|
||||||
const struct connection *conn = sc_conn(cs);
|
const struct connection *conn = sc_conn(cs);
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ static inline void cs_conn_shutr(struct stconn *cs, enum co_shr_mode mode)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* clean data-layer shutdown */
|
/* clean data-layer shutdown */
|
||||||
mux = cs_conn_mux(cs);
|
mux = sc_mux_ops(cs);
|
||||||
if (mux && mux->shutr)
|
if (mux && mux->shutr)
|
||||||
mux->shutr(cs, mode);
|
mux->shutr(cs, mode);
|
||||||
sc_ep_set(cs, (mode == CO_SHR_DRAIN) ? SE_FL_SHRD : SE_FL_SHRR);
|
sc_ep_set(cs, (mode == CO_SHR_DRAIN) ? SE_FL_SHRD : SE_FL_SHRR);
|
||||||
@ -250,7 +250,7 @@ static inline void cs_conn_shutw(struct stconn *cs, enum co_shw_mode mode)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* clean data-layer shutdown */
|
/* clean data-layer shutdown */
|
||||||
mux = cs_conn_mux(cs);
|
mux = sc_mux_ops(cs);
|
||||||
if (mux && mux->shutw)
|
if (mux && mux->shutw)
|
||||||
mux->shutw(cs, mode);
|
mux->shutw(cs, mode);
|
||||||
sc_ep_set(cs, (mode == CO_SHW_NORMAL) ? SE_FL_SHWN : SE_FL_SHWS);
|
sc_ep_set(cs, (mode == CO_SHW_NORMAL) ? SE_FL_SHWN : SE_FL_SHWS);
|
||||||
|
@ -1622,7 +1622,7 @@ int cs_conn_sync_recv(struct stconn *cs)
|
|||||||
if (!cs_state_in(cs->state, SC_SB_RDY|SC_SB_EST))
|
if (!cs_state_in(cs->state, SC_SB_RDY|SC_SB_EST))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!cs_conn_mux(cs))
|
if (!sc_mux_ops(cs))
|
||||||
return 0; // only stconns are supported
|
return 0; // only stconns are supported
|
||||||
|
|
||||||
if (cs->wait_event.events & SUB_RETRY_RECV)
|
if (cs->wait_event.events & SUB_RETRY_RECV)
|
||||||
@ -1800,7 +1800,7 @@ void cs_conn_sync_send(struct stconn *cs)
|
|||||||
if (!cs_state_in(cs->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST))
|
if (!cs_state_in(cs->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!cs_conn_mux(cs))
|
if (!sc_mux_ops(cs))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cs_conn_send(cs);
|
cs_conn_send(cs);
|
||||||
|
@ -278,7 +278,7 @@ static void strm_trace(enum trace_level level, uint64_t mask, const struct trace
|
|||||||
int stream_upgrade_from_cs(struct stconn *cs, struct buffer *input)
|
int stream_upgrade_from_cs(struct stconn *cs, struct buffer *input)
|
||||||
{
|
{
|
||||||
struct stream *s = __sc_strm(cs);
|
struct stream *s = __sc_strm(cs);
|
||||||
const struct mux_ops *mux = cs_conn_mux(cs);
|
const struct mux_ops *mux = sc_mux_ops(cs);
|
||||||
|
|
||||||
if (mux) {
|
if (mux) {
|
||||||
if (mux->flags & MX_FL_HTX)
|
if (mux->flags & MX_FL_HTX)
|
||||||
@ -466,7 +466,7 @@ struct stream *stream_new(struct session *sess, struct stconn *cs, struct buffer
|
|||||||
if (sc_ep_test(cs, SE_FL_WEBSOCKET))
|
if (sc_ep_test(cs, SE_FL_WEBSOCKET))
|
||||||
s->flags |= SF_WEBSOCKET;
|
s->flags |= SF_WEBSOCKET;
|
||||||
if (sc_conn(cs)) {
|
if (sc_conn(cs)) {
|
||||||
const struct mux_ops *mux = cs_conn_mux(cs);
|
const struct mux_ops *mux = sc_mux_ops(cs);
|
||||||
|
|
||||||
if (mux && mux->flags & MX_FL_HTX)
|
if (mux && mux->flags & MX_FL_HTX)
|
||||||
s->flags |= SF_HTX;
|
s->flags |= SF_HTX;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user