enum proto_proxy_side side;
const struct mux_ops *mux;
const char *alpn; /* Default alpn to set by default when the mux protocol is forced (optional, in binary form) */
+ int init_xprt;
struct list list;
};
{
struct connection *cli_conn = objt_conn(strm_orig(s));
struct connection *srv_conn = NULL;
+ const struct mux_proto_list *mux_proto;
struct server *srv;
int reuse_mode;
int reuse __maybe_unused = 0;
srv_conn->flags |= CO_FL_SOCKS4;
}
- if (srv && srv->mux_proto && isteq(srv->mux_proto->mux_proto, ist("qmux"))) {
- srv_conn->flags |= (CO_FL_QMUX_RECV|CO_FL_QMUX_SEND);
- may_start_mux_now = 0;
+ if (may_start_mux_now) {
+ /* Delay QMux MUX init to let xprt_qmux handshake runs first. */
+ mux_proto = conn_select_mux_be(srv_conn);
+ if (mux_proto && mux_proto->init_xprt == XPRT_QMUX) {
+ srv_conn->flags |= (CO_FL_QMUX_RECV|CO_FL_QMUX_SEND);
+ may_start_mux_now = 0;
+ }
}
#if defined(USE_OPENSSL) && defined(TLSEXT_TYPE_application_layer_protocol_negotiation)
};
static struct mux_proto_list mux_proto_qmux =
- { .mux_proto = IST("qmux"), .mode = PROTO_MODE_HTTP, .side = PROTO_SIDE_BOTH, .mux = &qmux_ops };
+ { .mux_proto = IST("qmux"), .mode = PROTO_MODE_HTTP, .side = PROTO_SIDE_BOTH, .mux = &qmux_ops,
+ .init_xprt = XPRT_QMUX };
INITCALL1(STG_REGISTER, register_mux_proto, &mux_proto_qmux);
if (l->bind_conf->options & BC_O_ACC_CIP)
cli_conn->flags |= CO_FL_ACCEPT_CIP;
- if (l->bind_conf->mux_proto && isteq(l->bind_conf->mux_proto->mux_proto, ist("qmux")))
+ if (l->bind_conf->mux_proto && l->bind_conf->mux_proto->init_xprt == XPRT_QMUX)
cli_conn->flags |= (CO_FL_QMUX_RECV|CO_FL_QMUX_SEND);
/* Add the handshake pseudo-XPRT */