From: Christopher Faulet Date: Mon, 15 Jul 2019 08:16:58 +0000 (+0200) Subject: MAJOR: http: Deprecate and ignore the option "http-use-htx" X-Git-Tag: v2.1-dev2~376 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=319303739ac029ba0fb160c4d2ef02a0949c7a1f;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c index 9c98a2371d..b3a8c8d3d0 100644 --- a/src/cfgparse-listen.c +++ b/src/cfgparse-listen.c @@ -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; diff --git a/src/mux_pt.c b/src/mux_pt.c index 323594f32d..0119cb9c25 100644 --- a/src/mux_pt.c +++ b/src/mux_pt.c @@ -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); diff --git a/src/proxy.c b/src/proxy.c index 329626821d..57efc389bb 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -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 } };