]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MAJOR: http: Deprecate and ignore the option "http-use-htx"
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 15 Jul 2019 08:16:58 +0000 (10:16 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 19 Jul 2019 07:18:27 +0000 (09:18 +0200)
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.

src/cfgparse-listen.c
src/mux_pt.c
src/proxy.c

index 9c98a2371d38c5cd541ed2f95e38644b3631dd25..b3a8c8d3d0429209defb0298bb43467d90841175 100644 (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;
index 323594f32db24b19bbf9fd9a46ef5fe1d30fc259..0119cb9c2592e78bdc0101813a77c35cd62e871a 100644 (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);
index 329626821da30b62b9480c1086b8e951cf9df1f2..57efc389bb97df28860b3fcbd3f92e3a0da409ed 100644 (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 }
 };