mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
MINOR: muxes: Rename mux_ctl_type values to use MUX_CTL_ prefix
Instead of the generic MUX_, we now use MUX_CTL_ prefix for all mux_ctl_type value. This will avoid any ambiguities with other enums, especially with a new one that will be added to get information on mux streams.
This commit is contained in:
parent
0b8e7d666e
commit
d982a37e4c
@ -333,10 +333,10 @@ enum proto_proxy_side {
|
|||||||
|
|
||||||
/* ctl command used by mux->ctl() */
|
/* ctl command used by mux->ctl() */
|
||||||
enum mux_ctl_type {
|
enum mux_ctl_type {
|
||||||
MUX_STATUS, /* Expects an int as output, sets it to a combinaison of MUX_STATUS flags */
|
MUX_CTL_STATUS, /* Expects an int as output, sets it to a combinaison of MUX_CTL_STATUS flags */
|
||||||
MUX_EXIT_STATUS, /* Expects an int as output, sets the mux exist/error/http status, if known or 0 */
|
MUX_CTL_EXIT_STATUS, /* Expects an int as output, sets the mux exist/error/http status, if known or 0 */
|
||||||
MUX_REVERSE_CONN, /* Notify about an active reverse connection accepted. */
|
MUX_CTL_REVERSE_CONN, /* Notify about an active reverse connection accepted. */
|
||||||
MUX_SUBS_RECV, /* Notify the mux it must wait for read events again */
|
MUX_CTL_SUBS_RECV, /* Notify the mux it must wait for read events again */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* response for ctl MUX_STATUS */
|
/* response for ctl MUX_STATUS */
|
||||||
@ -445,7 +445,7 @@ struct mux_ops {
|
|||||||
int (*avail_streams_uni)(struct connection *conn); /* Returns the number of unidirectional streams still available for a connection */
|
int (*avail_streams_uni)(struct connection *conn); /* Returns the number of unidirectional streams still available for a connection */
|
||||||
int (*used_streams)(struct connection *conn); /* Returns the number of streams in use on a connection. */
|
int (*used_streams)(struct connection *conn); /* Returns the number of streams in use on a connection. */
|
||||||
void (*destroy)(void *ctx); /* Let the mux know one of its users left, so it may have to disappear */
|
void (*destroy)(void *ctx); /* Let the mux know one of its users left, so it may have to disappear */
|
||||||
int (*ctl)(struct connection *conn, enum mux_ctl_type mux_ctl, void *arg); /* Provides information about the mux */
|
int (*ctl)(struct connection *conn, enum mux_ctl_type mux_ctl, void *arg); /* Provides information about the mux connection */
|
||||||
int (*takeover)(struct connection *conn, int orig_tid); /* Attempts to migrate the connection to the current thread */
|
int (*takeover)(struct connection *conn, int orig_tid); /* Attempts to migrate the connection to the current thread */
|
||||||
unsigned int flags; /* some flags characterizing the mux's capabilities (MX_FL_*) */
|
unsigned int flags; /* some flags characterizing the mux's capabilities (MX_FL_*) */
|
||||||
char name[8]; /* mux layer name, zero-terminated */
|
char name[8]; /* mux layer name, zero-terminated */
|
||||||
|
@ -1312,7 +1312,7 @@ static int do_connect_server(struct stream *s, struct connection *conn)
|
|||||||
* confirmed once we can send on it.
|
* confirmed once we can send on it.
|
||||||
*/
|
*/
|
||||||
/* Is the connection really ready ? */
|
/* Is the connection really ready ? */
|
||||||
if (conn->mux->ctl(conn, MUX_STATUS, NULL) & MUX_STATUS_READY)
|
if (conn->mux->ctl(conn, MUX_CTL_STATUS, NULL) & MUX_STATUS_READY)
|
||||||
s->scb->state = SC_ST_RDY;
|
s->scb->state = SC_ST_RDY;
|
||||||
else
|
else
|
||||||
s->scb->state = SC_ST_CON;
|
s->scb->state = SC_ST_CON;
|
||||||
@ -1717,7 +1717,7 @@ static int connect_server(struct stream *s)
|
|||||||
*/
|
*/
|
||||||
BUG_ON(!srv_conn->mux);
|
BUG_ON(!srv_conn->mux);
|
||||||
|
|
||||||
if (!(srv_conn->mux->ctl(srv_conn, MUX_STATUS, NULL) & MUX_STATUS_READY))
|
if (!(srv_conn->mux->ctl(srv_conn, MUX_CTL_STATUS, NULL) & MUX_STATUS_READY))
|
||||||
s->flags |= SF_SRV_REUSED_ANTICIPATED;
|
s->flags |= SF_SRV_REUSED_ANTICIPATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2654,7 +2654,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t
|
|||||||
logs = &tmp_strm_log;
|
logs = &tmp_strm_log;
|
||||||
|
|
||||||
if ((fe->mode == PR_MODE_HTTP) && fe_conn && fe_conn->mux && fe_conn->mux->ctl) {
|
if ((fe->mode == PR_MODE_HTTP) && fe_conn && fe_conn->mux && fe_conn->mux->ctl) {
|
||||||
enum mux_exit_status es = fe_conn->mux->ctl(fe_conn, MUX_EXIT_STATUS, &status);
|
enum mux_exit_status es = fe_conn->mux->ctl(fe_conn, MUX_CTL_EXIT_STATUS, &status);
|
||||||
|
|
||||||
switch (es) {
|
switch (es) {
|
||||||
case MUX_ES_SUCCESS:
|
case MUX_ES_SUCCESS:
|
||||||
|
@ -3091,11 +3091,11 @@ static int fcgi_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *ou
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
switch (mux_ctl) {
|
switch (mux_ctl) {
|
||||||
case MUX_STATUS:
|
case MUX_CTL_STATUS:
|
||||||
if (!(conn->flags & CO_FL_WAIT_XPRT))
|
if (!(conn->flags & CO_FL_WAIT_XPRT))
|
||||||
ret |= MUX_STATUS_READY;
|
ret |= MUX_STATUS_READY;
|
||||||
return ret;
|
return ret;
|
||||||
case MUX_EXIT_STATUS:
|
case MUX_CTL_EXIT_STATUS:
|
||||||
return MUX_ES_UNKNOWN;
|
return MUX_ES_UNKNOWN;
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -4812,11 +4812,11 @@ static int h1_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *outp
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
switch (mux_ctl) {
|
switch (mux_ctl) {
|
||||||
case MUX_STATUS:
|
case MUX_CTL_STATUS:
|
||||||
if (!(conn->flags & CO_FL_WAIT_XPRT))
|
if (!(conn->flags & CO_FL_WAIT_XPRT))
|
||||||
ret |= MUX_STATUS_READY;
|
ret |= MUX_STATUS_READY;
|
||||||
return ret;
|
return ret;
|
||||||
case MUX_EXIT_STATUS:
|
case MUX_CTL_EXIT_STATUS:
|
||||||
if (output)
|
if (output)
|
||||||
*((int *)output) = h1c->errcode;
|
*((int *)output) = h1c->errcode;
|
||||||
ret = (h1c->errcode == 408 ? MUX_ES_TOUT_ERR :
|
ret = (h1c->errcode == 408 ? MUX_ES_TOUT_ERR :
|
||||||
@ -4825,7 +4825,7 @@ static int h1_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *outp
|
|||||||
((h1c->errcode >= 400 && h1c->errcode <= 499) ? MUX_ES_INVALID_ERR :
|
((h1c->errcode >= 400 && h1c->errcode <= 499) ? MUX_ES_INVALID_ERR :
|
||||||
MUX_ES_SUCCESS))));
|
MUX_ES_SUCCESS))));
|
||||||
return ret;
|
return ret;
|
||||||
case MUX_SUBS_RECV:
|
case MUX_CTL_SUBS_RECV:
|
||||||
if (!(h1c->wait_event.events & SUB_RETRY_RECV))
|
if (!(h1c->wait_event.events & SUB_RETRY_RECV))
|
||||||
h1c->conn->xprt->subscribe(h1c->conn, h1c->conn->xprt_ctx, SUB_RETRY_RECV, &h1c->wait_event);
|
h1c->conn->xprt->subscribe(h1c->conn, h1c->conn->xprt_ctx, SUB_RETRY_RECV, &h1c->wait_event);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -4503,17 +4503,17 @@ static int h2_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *outp
|
|||||||
struct h2c *h2c = conn->ctx;
|
struct h2c *h2c = conn->ctx;
|
||||||
|
|
||||||
switch (mux_ctl) {
|
switch (mux_ctl) {
|
||||||
case MUX_STATUS:
|
case MUX_CTL_STATUS:
|
||||||
/* Only consider the mux to be ready if we're done with
|
/* Only consider the mux to be ready if we're done with
|
||||||
* the preface and settings, and we had no error.
|
* the preface and settings, and we had no error.
|
||||||
*/
|
*/
|
||||||
if (h2c->st0 >= H2_CS_FRAME_H && h2c->st0 < H2_CS_ERROR)
|
if (h2c->st0 >= H2_CS_FRAME_H && h2c->st0 < H2_CS_ERROR)
|
||||||
ret |= MUX_STATUS_READY;
|
ret |= MUX_STATUS_READY;
|
||||||
return ret;
|
return ret;
|
||||||
case MUX_EXIT_STATUS:
|
case MUX_CTL_EXIT_STATUS:
|
||||||
return MUX_ES_UNKNOWN;
|
return MUX_ES_UNKNOWN;
|
||||||
|
|
||||||
case MUX_REVERSE_CONN:
|
case MUX_CTL_REVERSE_CONN:
|
||||||
BUG_ON(h2c->flags & H2_CF_IS_BACK);
|
BUG_ON(h2c->flags & H2_CF_IS_BACK);
|
||||||
|
|
||||||
TRACE_DEVEL("connection reverse done, restart demux", H2_EV_H2C_WAKE, h2c->conn);
|
TRACE_DEVEL("connection reverse done, restart demux", H2_EV_H2C_WAKE, h2c->conn);
|
||||||
|
@ -784,11 +784,11 @@ static int mux_pt_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
switch (mux_ctl) {
|
switch (mux_ctl) {
|
||||||
case MUX_STATUS:
|
case MUX_CTL_STATUS:
|
||||||
if (!(conn->flags & CO_FL_WAIT_XPRT))
|
if (!(conn->flags & CO_FL_WAIT_XPRT))
|
||||||
ret |= MUX_STATUS_READY;
|
ret |= MUX_STATUS_READY;
|
||||||
return ret;
|
return ret;
|
||||||
case MUX_EXIT_STATUS:
|
case MUX_CTL_EXIT_STATUS:
|
||||||
return MUX_ES_UNKNOWN;
|
return MUX_ES_UNKNOWN;
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -422,7 +422,7 @@ struct connection *rhttp_accept_conn(struct listener *l, int *status)
|
|||||||
BUG_ON(!(conn->flags & CO_FL_ACT_REVERSING));
|
BUG_ON(!(conn->flags & CO_FL_ACT_REVERSING));
|
||||||
conn->flags &= ~CO_FL_ACT_REVERSING;
|
conn->flags &= ~CO_FL_ACT_REVERSING;
|
||||||
conn->flags |= CO_FL_REVERSED;
|
conn->flags |= CO_FL_REVERSED;
|
||||||
conn->mux->ctl(conn, MUX_REVERSE_CONN, NULL);
|
conn->mux->ctl(conn, MUX_CTL_REVERSE_CONN, NULL);
|
||||||
|
|
||||||
l->rx.rhttp.pend_conn = NULL;
|
l->rx.rhttp.pend_conn = NULL;
|
||||||
*status = CO_AC_NONE;
|
*status = CO_AC_NONE;
|
||||||
|
@ -2297,7 +2297,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
|
|||||||
struct connection *conn = sc_conn(scf);
|
struct connection *conn = sc_conn(scf);
|
||||||
|
|
||||||
if (conn && conn->mux && conn->mux->ctl)
|
if (conn && conn->mux && conn->mux->ctl)
|
||||||
conn->mux->ctl(conn, MUX_SUBS_RECV, NULL);
|
conn->mux->ctl(conn, MUX_CTL_SUBS_RECV, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user