From: Olivier Houchard Date: Tue, 24 Mar 2026 14:51:34 +0000 (+0100) Subject: BUG/MEDIUM: check: Don't reuse the server xprt if we should not X-Git-Tag: v3.4-dev8~108 X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/postgres_fdw.c?a=commitdiff_plain;h=07edaed1918a6433126b4d4d61b7f7b0e9324b30;p=haproxy.git BUG/MEDIUM: check: Don't reuse the server xprt if we should not Don't assume the check will reuse the server's xprt. It may not be true if some settings such as the ALPN has been set, and it differs from the server's one. If the server is QUIC, and we want to use TCP for checks, we certainly don't want to reuse its XPRT. --- diff --git a/src/check.c b/src/check.c index 45ada607c..0c1bdd25b 100644 --- a/src/check.c +++ b/src/check.c @@ -1813,7 +1813,15 @@ int init_srv_check(struct server *srv) * specified. */ if (!srv->check.port && !is_addr(&srv->check.addr)) { - if (!srv->check.use_ssl && srv->use_ssl != -1) + /* + * If any setting is set for the check, then we can't + * assume we'll use the same XPRT as the server, the + * server may be QUIC, but we want a TCP check. + */ + if (!srv->check.use_ssl && srv->use_ssl != -1 && + !srv->check.via_socks4 && !srv->check.send_proxy && + (!srv->check.alpn_len || (srv->check.alpn_len == srv->ssl_ctx.alpn_len && !strncmp(srv->check.alpn_str, srv->ssl_ctx.alpn_str, srv->check.alpn_len))) && + (!srv->check.mux_proto || srv->check.mux_proto != srv->mux_proto)) srv->check.xprt = srv->xprt; else if (srv->check.use_ssl == 1) srv->check.xprt = xprt_get(XPRT_SSL);