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.
This commit is contained in:
Christopher Faulet 2019-04-24 15:25:00 +02:00
parent c1918d1a8f
commit 4904058661
2 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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++) {