Now that which ALPN gets negociated for a given server, use that to
decide if we can create the mux right away in connect_server(), and use
it in conn_install_mux_be().
That way, we may create the mux soon enough for early data to be sent,
before the handshake has been completed.
This commit depends on several previous commits, and it has not been
deemed important enough to backport.
* anyway.
*/
if (IS_HTX_STRM(s) && srv && srv->use_ssl &&
- (srv->ssl_ctx.alpn_str || srv->ssl_ctx.npn_str))
+ (srv->ssl_ctx.alpn_str || srv->ssl_ctx.npn_str) &&
+ srv->path_params.nego_alpn[0] == 0)
may_start_mux_now = 0;
#endif
int alpn_len = 0;
int mode = conn_pr_mode_to_proto_mode(prx->mode);
- conn_get_alpn(conn, &alpn_str, &alpn_len);
+ if (!conn_get_alpn(conn, &alpn_str, &alpn_len)) {
+ if (srv && srv->path_params.nego_alpn[0]) {
+ alpn_str = srv->path_params.nego_alpn;
+ alpn_len = strlen(alpn_str);
+ }
+ }
mux_proto = ist2(alpn_str, alpn_len);
mux_ops = conn_get_best_mux(conn, mux_proto, PROTO_SIDE_BE, mode);