Instead of trying to switch from delayed start to instant start based
on a single condition, let's do the opposite and preset the condition
to instant start and detect what could cause it to be delayed, thus
falling back to the slow mode. The condition remains exactly the
inverted one and better matches the comment about ALPN being the only
cause of such a delay.
struct server *srv;
int reuse_mode;
int reuse __maybe_unused = 0;
- int may_start_mux_now = 0; // are we allowed to start the mux now ?
+ int may_start_mux_now = 1; // are we allowed to start the mux now ?
int err;
struct sockaddr_storage *bind_addr = NULL;
int64_t hash = 0;
if (err == SF_ERR_NONE) {
srv_conn = sc_conn(s->scb);
reuse = 1;
+ may_start_mux_now = 0;
}
}
* that this is skipped in TCP mode as we only want mux-pt
* anyway.
*/
- if (!srv ||
- (srv->use_ssl != 1 || (!(srv->ssl_ctx.alpn_str) && !(srv->ssl_ctx.npn_str)) ||
- !IS_HTX_STRM(s)))
+ if (IS_HTX_STRM(s) && srv && srv->use_ssl &&
+ (srv->ssl_ctx.alpn_str || srv->ssl_ctx.npn_str))
+ may_start_mux_now = 0;
#endif
- may_start_mux_now = 1;
/* process the case where the server requires the PROXY protocol to be sent */
srv_conn->send_proxy_ofs = 0;