{
struct session *sess;
struct server *srv;
- struct proxy *prx;
struct check *check;
struct ist alpn;
const char *alpn_str = NULL;
}
else {
srv = objt_server(conn->target);
- prx = objt_proxy(conn->target);
- if (srv)
- prx = srv->proxy;
-
- if (!prx) {
- /* Target should either be a server or a proxy.
+ if (!srv) {
+ /* Target must be a server.
* USE a full a BUG_ON() once considered definitive.
*/
BUG_ON_HOT(1);
return NULL;
}
- mode = conn_pr_mode_to_proto_mode(prx->mode);
+ mode = conn_pr_mode_to_proto_mode(srv->proxy->mode);
if (srv && srv->mux_proto)
return srv->mux_proto;
const struct mux_ops *force_mux_ops)
{
struct server *srv = objt_server(conn->target);
- struct proxy *prx = objt_proxy(conn->target);
const struct mux_ops *mux_ops;
- if (srv)
- prx = srv->proxy;
-
- if (!prx) // target must be either proxy or server
+ if (!srv) // target must be a server
return -1;
- if (srv && srv->mux_proto && likely(!force_mux_ops)) {
+ if (srv->mux_proto && likely(!force_mux_ops)) {
mux_ops = srv->mux_proto->mux;
}
- else if (srv && unlikely(force_mux_ops)) {
+ else if (unlikely(force_mux_ops)) {
mux_ops = force_mux_ops;
}
else {
struct ist alpn;
const char *alpn_str = NULL;
int alpn_len = 0;
- int mode = conn_pr_mode_to_proto_mode(prx->mode);
+ int mode = conn_pr_mode_to_proto_mode(srv->proxy->mode);
if (!conn_get_alpn(conn, &alpn_str, &alpn_len)) {
if (srv && srv->path_params.srv_hash == conn->hash_node.key && srv->path_params.nego_alpn[0]) {
* any ambiguity.
*/
if (!(conn->flags & CO_FL_PRIVATE) &&
- ((prx->options & PR_O_REUSE_MASK) != PR_O_REUSE_SAFE ||
+ ((srv->proxy->options & PR_O_REUSE_MASK) != PR_O_REUSE_SAFE ||
!(mux_ops->flags & MX_FL_HOL_RISK)))
conn->owner = NULL;
- return conn_install_mux(conn, mux_ops, ctx, prx, sess);
+ return conn_install_mux(conn, mux_ops, ctx, srv->proxy, sess);
}
/* installs the best mux for outgoing connection <conn> for a check using the
{
struct check *check = objt_check(sess->origin);
struct server *srv = objt_server(conn->target);
- struct proxy *prx = objt_proxy(conn->target);
const struct mux_ops *mux_ops;
if (!check) // Check must be defined
return -1;
- if (srv)
- prx = srv->proxy;
-
- if (!prx) // target must be either proxy or server
+ if (!srv) // target must be a proxy
return -1;
if (check->mux_proto)
if (!mux_ops)
return -1;
}
- return conn_install_mux(conn, mux_ops, ctx, prx, sess);
+ return conn_install_mux(conn, mux_ops, ctx, srv->proxy, sess);
}
/* Set the ALPN of connection <conn> to <alpn>. If force is false, <alpn> must
{
const struct listener *li;
const struct server *sv;
- const struct proxy *px;
char addr[40];
int old_len = buf->data;
chunk_appendf(buf, " fe=%s", li->bind_conf->frontend->id);
else if ((sv = objt_server(conn->target)))
chunk_appendf(buf, " sv=%s/%s", sv->proxy->id, sv->id);
- else if ((px = objt_proxy(conn->target)))
- chunk_appendf(buf, " be=%s", px->id);
chunk_appendf(buf, " %s/%s", conn_get_xprt_name(conn), conn_get_ctrl_name(conn));