]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: global: Set default tune.maxrewrite value during global structure init
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 22 Jan 2020 13:31:21 +0000 (14:31 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 6 Feb 2020 08:36:36 +0000 (09:36 +0100)
When the global structure is initialized, instead of setting tune.maxrewrite to
-1, its default value can be immediately set. This way, it is always defined
during the configuration validity check. Otherwise, the only way to have it at
this stage, it is to explicity set it in the global section.

src/haproxy.c

index 9c578d6d3aa6316ab2f09b48d48b5c1e30a0897b..5bca00212527dac07a716afb9ab669414090416e 100644 (file)
@@ -163,7 +163,7 @@ struct global global = {
        .tune = {
                .options = GTUNE_LISTENER_MQ,
                .bufsize = (BUFSIZE + 2*sizeof(void *) - 1) & -(2*sizeof(void *)),
-               .maxrewrite = -1,
+               .maxrewrite = MAXREWRITE,
                .chksize = (BUFSIZE + 2*sizeof(void *) - 1) & -(2*sizeof(void *)),
                .reserved_bufs = RESERVED_BUFS,
                .pattern_cache = DEFAULT_PAT_LRU_SIZE,
@@ -2164,9 +2164,6 @@ static void init(int argc, char **argv)
        if (global.tune.recv_enough == 0)
                global.tune.recv_enough = MIN_RECV_AT_ONCE_ENOUGH;
 
-       if (global.tune.maxrewrite < 0)
-               global.tune.maxrewrite = MAXREWRITE;
-
        if (global.tune.maxrewrite >= global.tune.bufsize / 2)
                global.tune.maxrewrite = global.tune.bufsize / 2;