]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: Make 'option forceclose' actually warn
authorTim Duesterhus <tim@bastelstu.be>
Tue, 14 May 2019 18:58:00 +0000 (20:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 16 May 2019 16:02:03 +0000 (18:02 +0200)
It is deprecated since 315b39c3914f4c2301ce19a93564566caa2ede50 (1.9-dev),
but only was deprecated in the docs.

Make it warn when being used and remove it from the docs.

doc/configuration.txt
examples/haproxy.vim
include/types/global.h
src/cfgparse-listen.c

index f1202796fc44576201b7c671c0caa1d003465f7b..8aa9f2c7b9a462b53009022d6f4fd4da24595a55 100644 (file)
@@ -2342,7 +2342,6 @@ option clitcpka                      (*)  X          X         X         -
 option contstats                     (*)  X          X         X         -
 option dontlog-normal                (*)  X          X         X         -
 option dontlognull                   (*)  X          X         X         -
-option forceclose       (deprecated) (*)  X          X         X         X
 -- keyword -------------------------- defaults - frontend - listen -- backend -
 option forwardfor                         X          X         X         X
 option http-buffer-request           (*)  X          X         X         X
@@ -6047,13 +6046,6 @@ no option dontlognull
              section 8 about logging.
 
 
-option forceclose (deprecated)
-no option forceclose (deprecated)
-  This is an alias for "option httpclose". Thus this option is deprecated.
-
-  See also : "option httpclose" and "option http-pretend-keepalive"
-
-
 option forwardfor [ except <network> ] [ header <name> ] [ if-none ]
   Enable insertion of the X-Forwarded-For header to requests sent to servers
   May be used in sections :   defaults | frontend | listen | backend
index 728a1c52e36929ac201c629e20e93fafee5bb60a..c13b2c0893e7e8e76402248dcde477aa12e20d9c 100644 (file)
@@ -82,7 +82,7 @@ syn keyword hapBalance   contained roundrobin source
 syn keyword hapLen       contained len
 syn keyword hapGLog      contained global
 syn keyword hapMode      contained http tcp health
-syn keyword hapOption    contained abortonclose allbackups checkcache clitcpka dontlognull forceclose forwardfor
+syn keyword hapOption    contained abortonclose allbackups checkcache clitcpka dontlognull forwardfor
 syn keyword hapOption    contained httpchk httpclose httplog keepalive logasap persist srvtcpka ssl-hello-chk
 syn keyword hapOption    contained tcplog tcpka tcpsplice
 syn keyword hapOption    contained except skipwhite nextgroup=hapIPv4Mask
index 2df0da9b4045cb7383d179bc3b7372b2d72737db..091506f61fcac748f435f0691de9e08bea1113e2 100644 (file)
@@ -251,6 +251,7 @@ __decl_hathreads(extern pthread_t *threads);
 #define WARN_CLITO_DEPRECATED       0x00000008
 #define WARN_SRVTO_DEPRECATED       0x00000010
 #define WARN_CONTO_DEPRECATED       0x00000020
+#define WARN_FORCECLOSE_DEPRECATED  0x00000040
 
 /* to be used with warned and WARN_* */
 static inline int already_warned(unsigned int warning)
index 7760d9c3ca9d663e8ba67e5b658559d5f887b662..9e2f44c14bf663ff6a9025d3b7313aaa80c44b8a 100644 (file)
@@ -2160,6 +2160,12 @@ stats_error_parsing:
                 * sections).
                 */
                if (strcmp(args[1], "httpclose") == 0 || strcmp(args[1], "forceclose") == 0) {
+                       if (strcmp(args[1], "forceclose") == 0) {
+                               if (!already_warned(WARN_FORCECLOSE_DEPRECATED))
+                                       ha_warning("parsing [%s:%d]: keyword '%s' is deprecated in favor of 'httpclose', and will not be supported by future versions.\n",
+                                         file, linenum, args[1]);
+                               err_code |= ERR_WARN;
+                       }
                        if (alertif_too_many_args_idx(0, 1, file, linenum, args, &err_code))
                                goto out;
                        if (kwm == KWM_STD) {