From: Christopher Faulet Date: Wed, 25 Nov 2020 16:20:57 +0000 (+0100) Subject: MINOR: config: Deprecate and ignore tune.chksize global option X-Git-Tag: v2.4-dev2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bb9fb8b7f832d3a2cb62f5b4046390ae7943fc16;p=thirdparty%2Fhaproxy.git MINOR: config: Deprecate and ignore tune.chksize global option 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. --- diff --git a/doc/configuration.txt b/doc/configuration.txt index e28601fd10..3ab2d48892 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -2146,12 +2146,8 @@ tune.bufsize 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 - 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 (deprecated) + This option is deprecated and ignored. tune.comp.maxlevel Sets the maximum compression level. The compression level affects CPU @@ -5283,7 +5279,7 @@ http-check expect [min-recv ] [comment ] 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 ] [comment ] 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 ] [comment ] 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 [comment ] @@ -11203,7 +11199,7 @@ tcp-check send-lf [comment ] 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 [comment ] @@ -11231,7 +11227,7 @@ tcp-check send-binary-lf [comment ] 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() diff --git a/include/haproxy/global-t.h b/include/haproxy/global-t.h index 8acba890b3..c19d069f0a 100644 --- a/include/haproxy/global-t.h +++ b/include/haproxy/global-t.h @@ -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 */ diff --git a/src/cfgparse-global.c b/src/cfgparse-global.c index 4547d962c0..ca447bb970 100644 --- a/src/cfgparse-global.c +++ b/src/cfgparse-global.c @@ -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)) diff --git a/src/haproxy.c b/src/haproxy.c index ae11f8dd5f..6d17f31c4b 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -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, diff --git a/src/payload.c b/src/payload.c index 52be7848a3..f867541bc5 100644 --- a/src/payload.c +++ b/src/payload.c @@ -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; diff --git a/src/tcpcheck.c b/src/tcpcheck.c index 2fa49ec49f..f5eb8e9d8e 100644 --- a/src/tcpcheck.c +++ b/src/tcpcheck.c @@ -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) {