diff --git a/include/haproxy/connection-t.h b/include/haproxy/connection-t.h index e64527de36..0c1fd92e08 100644 --- a/include/haproxy/connection-t.h +++ b/include/haproxy/connection-t.h @@ -333,10 +333,10 @@ enum proto_proxy_side { /* ctl command used by mux->ctl() */ enum mux_ctl_type { - MUX_STATUS, /* Expects an int as output, sets it to a combinaison of MUX_STATUS flags */ - MUX_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_SUBS_RECV, /* Notify the mux it must wait for read events again */ + MUX_CTL_STATUS, /* Expects an int as output, sets it to a combinaison of MUX_CTL_STATUS flags */ + MUX_CTL_EXIT_STATUS, /* Expects an int as output, sets the mux exist/error/http status, if known or 0 */ + MUX_CTL_REVERSE_CONN, /* Notify about an active reverse connection accepted. */ + MUX_CTL_SUBS_RECV, /* Notify the mux it must wait for read events again */ }; /* 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 (*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 */ - 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 */ unsigned int flags; /* some flags characterizing the mux's capabilities (MX_FL_*) */ char name[8]; /* mux layer name, zero-terminated */ diff --git a/src/backend.c b/src/backend.c index f4f714bc82..7d79eb173e 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1312,7 +1312,7 @@ static int do_connect_server(struct stream *s, struct connection *conn) * confirmed once we can send on it. */ /* 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; else s->scb->state = SC_ST_CON; @@ -1717,7 +1717,7 @@ static int connect_server(struct stream *s) */ 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; } diff --git a/src/log.c b/src/log.c index 156bf61cb6..010ace9dcb 100644 --- a/src/log.c +++ b/src/log.c @@ -2654,7 +2654,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t logs = &tmp_strm_log; 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) { case MUX_ES_SUCCESS: diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index d41318bb3f..73437be8a7 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -3091,11 +3091,11 @@ static int fcgi_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *ou { int ret = 0; switch (mux_ctl) { - case MUX_STATUS: + case MUX_CTL_STATUS: if (!(conn->flags & CO_FL_WAIT_XPRT)) ret |= MUX_STATUS_READY; return ret; - case MUX_EXIT_STATUS: + case MUX_CTL_EXIT_STATUS: return MUX_ES_UNKNOWN; default: return -1; diff --git a/src/mux_h1.c b/src/mux_h1.c index 73338774cb..9be77a177e 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -4812,11 +4812,11 @@ static int h1_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *outp int ret = 0; switch (mux_ctl) { - case MUX_STATUS: + case MUX_CTL_STATUS: if (!(conn->flags & CO_FL_WAIT_XPRT)) ret |= MUX_STATUS_READY; return ret; - case MUX_EXIT_STATUS: + case MUX_CTL_EXIT_STATUS: if (output) *((int *)output) = h1c->errcode; 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 : MUX_ES_SUCCESS)))); return ret; - case MUX_SUBS_RECV: + case MUX_CTL_SUBS_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); return 0; diff --git a/src/mux_h2.c b/src/mux_h2.c index ff6a85a2f9..5f85c00113 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -4503,17 +4503,17 @@ static int h2_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *outp struct h2c *h2c = conn->ctx; switch (mux_ctl) { - case MUX_STATUS: + case MUX_CTL_STATUS: /* Only consider the mux to be ready if we're done with * the preface and settings, and we had no error. */ if (h2c->st0 >= H2_CS_FRAME_H && h2c->st0 < H2_CS_ERROR) ret |= MUX_STATUS_READY; return ret; - case MUX_EXIT_STATUS: + case MUX_CTL_EXIT_STATUS: return MUX_ES_UNKNOWN; - case MUX_REVERSE_CONN: + case MUX_CTL_REVERSE_CONN: BUG_ON(h2c->flags & H2_CF_IS_BACK); TRACE_DEVEL("connection reverse done, restart demux", H2_EV_H2C_WAKE, h2c->conn); diff --git a/src/mux_pt.c b/src/mux_pt.c index f79e3c8e45..47aa5e645a 100644 --- a/src/mux_pt.c +++ b/src/mux_pt.c @@ -784,11 +784,11 @@ static int mux_pt_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void * { int ret = 0; switch (mux_ctl) { - case MUX_STATUS: + case MUX_CTL_STATUS: if (!(conn->flags & CO_FL_WAIT_XPRT)) ret |= MUX_STATUS_READY; return ret; - case MUX_EXIT_STATUS: + case MUX_CTL_EXIT_STATUS: return MUX_ES_UNKNOWN; default: return -1; diff --git a/src/proto_rhttp.c b/src/proto_rhttp.c index 9acc411438..452ee32d79 100644 --- a/src/proto_rhttp.c +++ b/src/proto_rhttp.c @@ -422,7 +422,7 @@ struct connection *rhttp_accept_conn(struct listener *l, int *status) BUG_ON(!(conn->flags & CO_FL_ACT_REVERSING)); conn->flags &= ~CO_FL_ACT_REVERSING; 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; *status = CO_AC_NONE; diff --git a/src/stream.c b/src/stream.c index 819564c0af..aceae19e36 100644 --- a/src/stream.c +++ b/src/stream.c @@ -2297,7 +2297,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) struct connection *conn = sc_conn(scf); if (conn && conn->mux && conn->mux->ctl) - conn->mux->ctl(conn, MUX_SUBS_RECV, NULL); + conn->mux->ctl(conn, MUX_CTL_SUBS_RECV, NULL); } } }