]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: config: Deprecate and ignore tune.chksize global option
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 25 Nov 2020 16:20:57 +0000 (17:20 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 27 Nov 2020 09:30:23 +0000 (10:30 +0100)
This option is now ignored because I/O check buffers are now allocated using the
buffer pool. Thus, it is marked as deprecated in the documentation and ignored
during the configuration parsing. The field is also removed from the global
structure.

Because this option is ignored since a recent fix, backported as fare as 2.2,
this patch should be backported too. Especially because it updates the
documentation.

doc/configuration.txt
include/haproxy/global-t.h
src/cfgparse-global.c
src/haproxy.c
src/payload.c
src/tcpcheck.c

index e28601fd10f58e57680ffa42dec9a8943c0d1f0e..3ab2d48892d0fafbaeec3090bdd487773c3fab39 100644 (file)
@@ -2146,12 +2146,8 @@ tune.bufsize <number>
   value set using this parameter will automatically be rounded up to the next
   multiple of 8 on 32-bit machines and 16 on 64-bit machines.
 
-tune.chksize <number>
-  Sets the check buffer size to this size (in bytes). Higher values may help
-  find string or regex patterns in very large pages, though doing so may imply
-  more memory and CPU usage. The default value is 16384 and can be changed at
-  build time. It is not recommended to change this value, but to use better
-  checks whenever possible.
+tune.chksize <number> (deprecated)
+  This option is deprecated and ignored.
 
 tune.comp.maxlevel <number>
   Sets the maximum compression level. The compression level affects CPU
@@ -5283,7 +5279,7 @@ http-check expect [min-recv <int>] [comment <msg>]
                       considered invalid if the body contains the string.
 
   It is important to note that the responses will be limited to a certain size
-  defined by the global "tune.chksize" option, which defaults to 16384 bytes.
+  defined by the global "tune.bufsize" option, which defaults to 16384 bytes.
   Thus, too large responses may not contain the mandatory pattern when using
   "string" or "rstring". If a large response is absolutely required, it is
   possible to change the default max size by setting the global variable.
@@ -11146,7 +11142,7 @@ tcp-check expect [min-recv <int>] [comment <msg>]
                          buffer.
 
   It is important to note that the responses will be limited to a certain size
-  defined by the global "tune.chksize" option, which defaults to 16384 bytes.
+  defined by the global "tune.bufsize" option, which defaults to 16384 bytes.
   Thus, too large responses may not contain the mandatory pattern when using
   "string", "rstring" or binary. If a large response is absolutely required, it
   is possible to change the default max size by setting the global variable.
@@ -11177,7 +11173,7 @@ tcp-check expect [min-recv <int>] [comment <msg>]
 
 
   See also : "option tcp-check", "tcp-check connect", "tcp-check send",
-             "tcp-check send-binary", "http-check expect", tune.chksize
+             "tcp-check send-binary", "http-check expect", tune.bufsize
 
 
 tcp-check send <data> [comment <msg>]
@@ -11203,7 +11199,7 @@ tcp-check send-lf <fmt> [comment <msg>]
          tcp-check expect string role:master
 
   See also : "option tcp-check", "tcp-check connect", "tcp-check expect",
-             "tcp-check send-binary", tune.chksize
+             "tcp-check send-binary", tune.bufsize
 
 
 tcp-check send-binary <hexstring> [comment <msg>]
@@ -11231,7 +11227,7 @@ tcp-check send-binary-lf <hexfmt> [comment <msg>]
 
 
   See also : "option tcp-check", "tcp-check connect", "tcp-check expect",
-             "tcp-check send", tune.chksize
+             "tcp-check send", tune.bufsize
 
 
 tcp-check set-var(<var-name>) <expr>
index 8acba890b34a4b876ab262b3c962a02f44710258..c19d069f0a67ce157f89ae223e32e5a13b6e7b98 100644 (file)
@@ -151,7 +151,6 @@ struct global {
                int client_rcvbuf; /* set client rcvbuf to this value if not null */
                int server_sndbuf; /* set server sndbuf to this value if not null */
                int server_rcvbuf; /* set server rcvbuf to this value if not null */
-               int chksize;       /* check buffer size in bytes, defaults to BUFSIZE */
                int pipesize;      /* pipe size in bytes, system defaults if zero */
                int max_http_hdr;  /* max number of HTTP headers, use MAX_HTTP_HDR if zero */
                int requri_len;    /* max len of request URI, use REQURI_LEN if zero */
index 4547d962c0c59fc95716a4b90a41885cb47d7ab3..ca447bb97067dbf6b273dedb744ad458ac8351ea 100644 (file)
@@ -190,14 +190,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
                global.tune.maxaccept = max;
        }
        else if (!strcmp(args[0], "tune.chksize")) {
-               if (alertif_too_many_args(1, file, linenum, args, &err_code))
-                       goto out;
-               if (*(args[1]) == 0) {
-                       ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]);
-                       err_code |= ERR_ALERT | ERR_FATAL;
-                       goto out;
-               }
-               global.tune.chksize = atol(args[1]);
+               /* Deprecated now */
        }
        else if (!strcmp(args[0], "tune.recv_enough")) {
                if (alertif_too_many_args(1, file, linenum, args, &err_code))
index ae11f8dd5fc914da660b82c0459889453cde25e7..6d17f31c4b4d99efbc3990b9bf2113f6f7245d5d 100644 (file)
@@ -164,7 +164,6 @@ struct global global = {
                .options = GTUNE_LISTENER_MQ,
                .bufsize = (BUFSIZE + 2*sizeof(void *) - 1) & -(2*sizeof(void *)),
                .maxrewrite = MAXREWRITE,
-               .chksize = (BUFSIZE + 2*sizeof(void *) - 1) & -(2*sizeof(void *)),
                .reserved_bufs = RESERVED_BUFS,
                .pattern_cache = DEFAULT_PAT_LRU_SIZE,
                .pool_low_ratio  = 20,
index 52be7848a3a12512e19c5ddbab2035ff90c75ecb..f867541bc563b177adcda0d63e148527b8acfcfd 100644 (file)
@@ -976,14 +976,13 @@ smp_fetch_payload_lv(const struct arg *arg_p, struct sample *smp, const char *kw
                chn = ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &smp->strm->res : &smp->strm->req;
                head = ci_head(chn);
                data = ci_data(chn);
-               max  = global.tune.bufsize;
        }
        else if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK) {
                struct buffer *buf = &(__objt_check(smp->sess->origin)->bi);
                head = b_head(buf);
                data = b_data(buf);
-               max  = global.tune.chksize;
        }
+       max = global.tune.bufsize;
        if (!head)
                return 0;
 
@@ -1039,14 +1038,13 @@ smp_fetch_payload(const struct arg *arg_p, struct sample *smp, const char *kw, v
                chn = ((smp->opt & SMP_OPT_DIR) == SMP_OPT_DIR_RES) ? &smp->strm->res : &smp->strm->req;
                head = ci_head(chn);
                data = ci_data(chn);
-               max  = global.tune.bufsize;
        }
        else if (obj_type(smp->sess->origin) == OBJ_TYPE_CHECK) {
                struct buffer *buf = &(__objt_check(smp->sess->origin)->bi);
                head = b_head(buf);
                data = b_data(buf);
-               max  = global.tune.chksize;
        }
+       max = global.tune.bufsize;
        if (!head)
                return 0;
 
index 2fa49ec49fe37f27c066c280b97e583049409329..f5eb8e9d8e8fa209e502b8c0184c24c2f23dc965 100644 (file)
@@ -2737,7 +2737,7 @@ struct tcpcheck_rule *parse_tcpcheck_expect(char **args, int cur_arg, struct pro
                                memprintf(errmsg, "'%s' expects a integer as argument", args[cur_arg]);
                                goto error;
                        }
-                       /* Use an signed integer here because of chksize */
+                       /* Use an signed integer here because of bufsize */
                        cur_arg++;
                        min_recv = atol(args[cur_arg]);
                        if (min_recv < -1 || min_recv > INT_MAX) {