MAJOR: http: Deprecate and ignore the option "http-use-htx"

From this commit, the legacy HTTP mode is now definitely disabled. It is the
first commit of a long series to remove the legacy HTTP code. Now, all HTTP
processing is done using the HTX internal representation. Since the version 2.0,
It is the default mode. So now, it is no more possible to disable the HTX to
fallback on the legacy HTTP mode. If you still use "[no] option http-use-htx", a
warning will be emitted during HAProxy startup. Note the passthough multiplexer
is now only usable for TCP proxies.
This commit is contained in:
Christopher Faulet 2019-07-15 10:16:58 +02:00
parent bda62e756a
commit 319303739a
3 changed files with 13 additions and 4 deletions

View File

@ -2152,6 +2152,15 @@ stats_error_parsing:
goto out;
}
/* "[no] option http-use-htx" is deprecated */
if (!strcmp(cfg_opts2[optnum].name, "http-use-htx")) {
ha_warning("parsing [%s:%d]: option '%s' is deprecated and ignored."
" The HTX mode is now the only supported mode.\n",
file, linenum, cfg_opts2[optnum].name);
err_code |= ERR_WARN;
goto out;
}
curproxy->no_options2 &= ~cfg_opts2[optnum].val;
curproxy->options2 &= ~cfg_opts2[optnum].val;
@ -2704,7 +2713,7 @@ stats_error_parsing:
int cur_arg;
/* insert x-forwarded-for field, but not for the IP address listed as an except.
* set default options (ie: bitfield, header name, etc)
* set default options (ie: bitfield, header name, etc)
*/
curproxy->options |= PR_O_FWDFOR | PR_O_FF_ALWAYS;
@ -3674,7 +3683,7 @@ stats_error_parsing:
goto out;
}
/* we must first clear any optional default setting */
/* we must first clear any optional default setting */
curproxy->conn_src.opts &= ~CO_SRC_TPROXY_MASK;
free(curproxy->conn_src.iface_name);
curproxy->conn_src.iface_name = NULL;

View File

@ -341,6 +341,6 @@ const struct mux_ops mux_pt_ops = {
/* PROT selection : default mux has empty name */
static struct mux_proto_list mux_proto_pt =
{ .token = IST(""), .mode = PROTO_MODE_ANY, .side = PROTO_SIDE_BOTH, .mux = &mux_pt_ops };
{ .token = IST(""), .mode = PROTO_MODE_TCP, .side = PROTO_SIDE_BOTH, .mux = &mux_pt_ops };
INITCALL1(STG_REGISTER, register_mux_proto, &mux_proto_pt);

View File

@ -110,7 +110,7 @@ const struct cfg_opt cfg_opts2[] =
{ "http-use-proxy-header", PR_O2_USE_PXHDR, PR_CAP_FE, 0, PR_MODE_HTTP },
{ "http-pretend-keepalive", PR_O2_FAKE_KA, PR_CAP_BE, 0, PR_MODE_HTTP },
{ "http-no-delay", PR_O2_NODELAY, PR_CAP_FE|PR_CAP_BE, 0, PR_MODE_HTTP },
{ "http-use-htx", PR_O2_USE_HTX, PR_CAP_FE|PR_CAP_BE, 0, 0 },
{ "http-use-htx", 0, PR_CAP_FE|PR_CAP_BE, 0, 0 }, // deprecated
{ NULL, 0, 0, 0 }
};