From: Christopher Faulet Date: Wed, 24 Apr 2019 13:25:00 +0000 (+0200) Subject: BUG/MINOR: htx: Exclude TCP proxies when the HTX mode is handled during startup X-Git-Tag: v2.0-dev3~181 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=4904058661025ed794c553a5ef4a40d133f73a3a;p=haproxy.git BUG/MINOR: htx: Exclude TCP proxies when the HTX mode is handled during startup When tests are performed on the HTX mode during HAProxy startup, only HTTP proxies are considered. It is important because, since the commit 1d2b586cd ("MAJOR: htx: Enable the HTX mode by default for all proxies"), the HTX is enabled on all proxies by default. But for TCP proxies, it is "deactivated". This patch must be backported to 1.9. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index ffff9cc6b..9a03a02bb 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -3484,8 +3484,8 @@ out_uri_auth_compat: int mode = (1 << (curproxy->mode == PR_MODE_HTTP)); const struct mux_proto_list *mux_ent; - /* Special case for HTX because it is still experimental */ - if (curproxy->options2 & PR_O2_USE_HTX) + /* Special case for HTX because legacy HTTP still exists */ + if (mode == PROTO_MODE_HTTP && (curproxy->options2 & PR_O2_USE_HTX)) mode = PROTO_MODE_HTX; if (!bind_conf->mux_proto) @@ -3513,8 +3513,8 @@ out_uri_auth_compat: int mode = (1 << (curproxy->mode == PR_MODE_HTTP)); const struct mux_proto_list *mux_ent; - /* Special case for HTX because it is still experimental */ - if (curproxy->options2 & PR_O2_USE_HTX) + /* Special case for HTX because legacy HTTP still exists */ + if (mode == PROTO_MODE_HTTP && (curproxy->options2 & PR_O2_USE_HTX)) mode = PROTO_MODE_HTX; if (!newsrv->mux_proto) diff --git a/src/http_htx.c b/src/http_htx.c index 21a5b57f4..8a407cdff 100644 --- a/src/http_htx.c +++ b/src/http_htx.c @@ -714,7 +714,7 @@ static int http_htx_init(void) int err_code = 0; for (px = proxies_list; px; px = px->next) { - if (!(px->options2 & PR_O2_USE_HTX)) + if (px->mode != PR_MODE_HTTP || !(px->options2 & PR_O2_USE_HTX)) continue; for (rc = 0; rc < HTTP_ERR_SIZE; rc++) {