From 73e8ede156b7fa889638d1f8f9e732dbb8c1c7af Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 16 Jul 2019 15:04:46 +0200 Subject: [PATCH] MINOR: proxy: Remove support of the option 'http-tunnel' The option 'http-tunnel' is deprecated and it was only used in the legacy HTTP mode. So this option is now totally ignored and a warning is emitted during HAProxy startup if it is found in a configuration file. --- include/types/proxy.h | 4 ++-- src/cfgparse-listen.c | 20 ++++---------------- src/cfgparse.c | 7 ------- 3 files changed, 6 insertions(+), 25 deletions(-) diff --git a/include/types/proxy.h b/include/types/proxy.h index 55afed771..86788a1e6 100644 --- a/include/types/proxy.h +++ b/include/types/proxy.h @@ -117,8 +117,8 @@ enum PR_SRV_STATE_FILE { #define PR_O_HTTP_KAL 0x00000000 /* HTTP keep-alive mode (http-keep-alive) */ #define PR_O_HTTP_CLO 0x01000000 /* HTTP close mode (httpclose) */ #define PR_O_HTTP_SCL 0x02000000 /* HTTP server close mode (http-server-close) */ -#define PR_O_HTTP_TUN 0x04000000 /* HTTP tunnel mode : no analysis past first request/response */ -#define PR_O_HTTP_MODE 0x07000000 /* MASK to retrieve the HTTP mode */ +#define PR_O_HTTP_MODE 0x03000000 /* MASK to retrieve the HTTP mode */ +/* unused: 0x04000000 */ #define PR_O_TCPCHK_SSL 0x08000000 /* at least one TCPCHECK connect rule requires SSL */ #define PR_O_CONTSTATS 0x10000000 /* continuous counters */ diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c index 9c266bd79..c2741a46c 100644 --- a/src/cfgparse-listen.c +++ b/src/cfgparse-listen.c @@ -2232,22 +2232,10 @@ stats_error_parsing: } } else if (strcmp(args[1], "http-tunnel") == 0) { - if (warnifnotcap(curproxy, PR_CAP_FE, file, linenum, args[1], NULL)) { - err_code |= ERR_WARN; - goto out; - } - if (alertif_too_many_args_idx(0, 1, file, linenum, args, &err_code)) - goto out; - if (kwm == KWM_STD) { - curproxy->options &= ~PR_O_HTTP_MODE; - curproxy->options |= PR_O_HTTP_TUN; - goto out; - } - else if (kwm == KWM_NO) { - if ((curproxy->options & PR_O_HTTP_MODE) == PR_O_HTTP_TUN) - curproxy->options &= ~PR_O_HTTP_MODE; - goto out; - } + ha_warning("parsing [%s:%d]: the option '%s' is deprecated and will be removed in next version.\n", + file, linenum, args[1]); + err_code |= ERR_WARN; + goto out; } /* Redispatch can take an integer argument that control when the diff --git a/src/cfgparse.c b/src/cfgparse.c index cb3279ae5..a58c33d3c 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -3611,13 +3611,6 @@ out_uri_auth_compat: newsrv->mux_proto = mux_ent; } - /* the option "http-tunnel" is deprecated and ignored. So emit a warning if the option is set. */ - if ((curproxy->options & PR_O_HTTP_MODE) == PR_O_HTTP_TUN) { - ha_warning("config : %s '%s' : the option 'http-tunnel' is deprecated and will be removed in next version.\n", - proxy_type_str(curproxy), curproxy->id); - curproxy->options &= ~PR_O_HTTP_MODE; - } - /* initialize idle conns lists */ for (newsrv = curproxy->srv; newsrv; newsrv = newsrv->next) { int i;