/* 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 */
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 */
* 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;
*/
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;
}
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:
{
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;
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 :
((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;
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);
{
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;
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;
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);
}
}
}