]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: config: remove obsolete use of DEFAULT_MAXCONN at various places
authorWilly Tarreau <w@1wt.eu>
Wed, 13 Mar 2019 09:03:07 +0000 (10:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 13 Mar 2019 09:10:25 +0000 (10:10 +0100)
This entry was still set to 2000 but never used anymore. The only places
where it appeared was as an alias to SYSTEM_MAXCONN which forces it, so
let's turn these ones to SYSTEM_MAXCONN and remove the default value for
DEFAULT_MAXCONN. SYSTEM_MAXCONN still defines the upper bound however.

include/common/defaults.h
src/cfgparse-global.c
src/haproxy.c

index cdc66650bb4af23552e126ba45715af194e894bb..80ef2c955bb572e69e6628f17961f72664dddc42 100644 (file)
  * emitted. The only way to override this limit will be to set it via the
  * command-line '-n' argument.
  */
-#ifndef SYSTEM_MAXCONN
-#ifndef DEFAULT_MAXCONN
-#define DEFAULT_MAXCONN 2000
-#endif
-#else
+#ifdef SYSTEM_MAXCONN
 #undef  DEFAULT_MAXCONN
 #define DEFAULT_MAXCONN SYSTEM_MAXCONN
 #endif
index 117347aba45d5e18d79c8f5d9e23e4daa1fa757a..92a089f8a678940e0ab87dec4b01dda6f7e1d06c 100644 (file)
@@ -528,9 +528,9 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm)
                }
                global.maxconn = atol(args[1]);
 #ifdef SYSTEM_MAXCONN
-               if (global.maxconn > DEFAULT_MAXCONN && cfg_maxconn <= DEFAULT_MAXCONN) {
-                       ha_alert("parsing [%s:%d] : maxconn value %d too high for this system.\nLimiting to %d. Please use '-n' to force the value.\n", file, linenum, global.maxconn, DEFAULT_MAXCONN);
-                       global.maxconn = DEFAULT_MAXCONN;
+               if (global.maxconn > SYSTEM_MAXCONN && cfg_maxconn <= SYSTEM_MAXCONN) {
+                       ha_alert("parsing [%s:%d] : maxconn value %d too high for this system.\nLimiting to %d. Please use '-n' to force the value.\n", file, linenum, global.maxconn, SYSTEM_MAXCONN);
+                       global.maxconn = SYSTEM_MAXCONN;
                        err_code |= ERR_ALERT;
                }
 #endif /* SYSTEM_MAXCONN */
index 781d962062e69c4f5db0bb0a78eae2fad94c3b17..7095d70d91bd819be47b5c47fa29f1408dd855ef 100644 (file)
@@ -398,9 +398,9 @@ static void display_build_opts()
               "\n  OPTIONS = " BUILD_OPTIONS
 #endif
               "\n\nDefault settings :"
-              "\n  maxconn = %d, bufsize = %d, maxrewrite = %d, maxpollevents = %d"
+              "\n  bufsize = %d, maxrewrite = %d, maxpollevents = %d"
               "\n\n",
-              DEFAULT_MAXCONN, BUFSIZE, MAXREWRITE, MAX_POLL_EVENTS);
+              BUFSIZE, MAXREWRITE, MAX_POLL_EVENTS);
 
        list_for_each_entry(item, &build_opts_list, list) {
                puts(item->str);
@@ -437,7 +437,7 @@ static void usage(char *name)
 #endif
                "        -q quiet mode : don't display messages\n"
                "        -c check mode : only check config files and exit\n"
-               "        -n sets the maximum total # of connections (%d)\n"
+               "        -n sets the maximum total # of connections (uses ulimit -n)\n"
                "        -m limits the usable amount of memory (in MB)\n"
                "        -N sets the default, per-proxy maximum # of connections (%d)\n"
                "        -L set local peer name (default to hostname)\n"
@@ -466,7 +466,7 @@ static void usage(char *name)
                "        -x <unix_socket> get listening sockets from a unix socket\n"
                "        -S <unix_socket>[,<bind options>...] new stats socket for the master\n"
                "\n",
-               name, DEFAULT_MAXCONN, cfg_maxpconn);
+               name, cfg_maxpconn);
        exit(1);
 }
 
@@ -2065,8 +2065,8 @@ static void init(int argc, char **argv)
                global.maxconn = MIN(global.maxconn, ideal_maxconn);
                global.maxconn = round_2dig(global.maxconn);
 #ifdef SYSTEM_MAXCONN
-               if (global.maxconn > DEFAULT_MAXCONN)
-                       global.maxconn = DEFAULT_MAXCONN;
+               if (global.maxconn > SYSTEM_MAXCONN)
+                       global.maxconn = SYSTEM_MAXCONN;
 #endif /* SYSTEM_MAXCONN */
                global.maxsslconn = sides * global.maxconn;
                if (global.mode & (MODE_VERBOSE|MODE_DEBUG))
@@ -2130,8 +2130,8 @@ static void init(int argc, char **argv)
                global.maxconn = MIN(global.maxconn, ideal_maxconn);
                global.maxconn = round_2dig(global.maxconn);
 #ifdef SYSTEM_MAXCONN
-               if (global.maxconn > DEFAULT_MAXCONN)
-                       global.maxconn = DEFAULT_MAXCONN;
+               if (global.maxconn > SYSTEM_MAXCONN)
+                       global.maxconn = SYSTEM_MAXCONN;
 #endif /* SYSTEM_MAXCONN */
 
                if (clearmem <= 0 || !global.maxconn) {