mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
BUG/MEDIUM: check: reuse srv proto only if using same mode
Only reuse the mux from server if the check is using the same mode. For example, this prevents a tcp-check on a h2 server to select the h2 multiplexer instead of passthrough. This bug was introduced by the following commit : BUG/MEDIUM: checks: Use the mux protocol specified on the server line It must be backported up to 2.2. Fixes github issue #945.
This commit is contained in:
parent
97fc8da264
commit
0519bd4d04
@ -1228,10 +1228,12 @@ static int init_srv_check(struct server *srv)
|
|||||||
const char *err;
|
const char *err;
|
||||||
struct tcpcheck_rule *r;
|
struct tcpcheck_rule *r;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
int check_type;
|
||||||
|
|
||||||
if (!srv->do_check)
|
if (!srv->do_check)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
check_type = srv->check.tcpcheck_rules->flags & TCPCHK_RULES_PROTO_CHK;
|
||||||
|
|
||||||
/* If neither a port nor an addr was specified and no check transport
|
/* If neither a port nor an addr was specified and no check transport
|
||||||
* layer is forced, then the transport layer used by the checks is the
|
* layer is forced, then the transport layer used by the checks is the
|
||||||
@ -1253,8 +1255,11 @@ static int init_srv_check(struct server *srv)
|
|||||||
/* Inherit the mux protocol from the server if not already defined for
|
/* Inherit the mux protocol from the server if not already defined for
|
||||||
* the check
|
* the check
|
||||||
*/
|
*/
|
||||||
if (srv->mux_proto && !srv->check.mux_proto)
|
if (srv->mux_proto && !srv->check.mux_proto &&
|
||||||
|
((srv->mux_proto->mode == PROTO_MODE_HTTP && check_type == TCPCHK_RULES_HTTP_CHK) ||
|
||||||
|
(srv->mux_proto->mode == PROTO_MODE_TCP && check_type != TCPCHK_RULES_HTTP_CHK))) {
|
||||||
srv->check.mux_proto = srv->mux_proto;
|
srv->check.mux_proto = srv->mux_proto;
|
||||||
|
}
|
||||||
|
|
||||||
/* validate <srv> server health-check settings */
|
/* validate <srv> server health-check settings */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user