static struct mux_proto_list mux_proto_qmux =
{ .mux_proto = IST("qmux"), .mode = PROTO_MODE_HTTP, .side = PROTO_SIDE_BOTH, .mux = &qmux_ops,
- .init_xprt = XPRT_QMUX };
+ .alpn = "\002h3", .init_xprt = XPRT_QMUX };
INITCALL1(STG_REGISTER, register_mux_proto, &mux_proto_qmux);
* woke a tasklet already.
*/
if (ctx->conn->xprt_ctx == ctx) {
+ const struct mux_proto_list *mux;
int closed_connection = 0;
if (!ctx->conn->mux) {
- if (ctx->conn->flags & (CO_FL_QMUX_RECV|CO_FL_QMUX_SEND)) {
+ mux = !conn_is_back(conn) ?
+ conn_select_mux_fe(conn) : conn_select_mux_be(conn);
+
+ if (ctx->conn->flags & (CO_FL_QMUX_RECV|CO_FL_QMUX_SEND) ||
+ mux->init_xprt == XPRT_QMUX) {
const struct xprt_ops *ops = xprt_get(XPRT_QMUX);
void *xprt_ctx_hs = NULL;
ret = conn->xprt->start(conn, xprt_ctx_hs);
BUG_ON(ret);
}
- else
+ else {
+ /* TODO MUX selection already performs by conn_select_mux_fe/be().
+ * Implement an alternative to conn_create_mux() to skip this
+ * part and directly init the connection and its MUX.
+ */
ret = conn_create_mux(ctx->conn, &closed_connection);
+ }
}
if (ret >= 0 && ctx->conn->mux && !woke && ctx->conn->mux && ctx->conn->mux->wake) {
ctx->lparams.initial_max_stream_data_bidi_remote = qcm_stream_rx_bufsz();
ctx->lparams.initial_max_stream_data_uni = qcm_stream_rx_bufsz();
+ /* Ensure the connection flags are set. Necessary when current XPRT is
+ * activated without explicit "proto qmux" configuration.
+ */
+ conn->flags |= (CO_FL_QMUX_RECV|CO_FL_QMUX_SEND);
+
*xprt_ctx = ctx;
return 0;