]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli: allow to set frontend maxconn to zero
authorWilly Tarreau <w@1wt.eu>
Wed, 26 Sep 2012 19:07:15 +0000 (21:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 26 Sep 2012 19:07:15 +0000 (21:07 +0200)
It is sometimes useful to completely disable accepting new connections
on a frontend during maintenance operations. By setting a frontend's
maxconn to zero, connections are not accepted anymore until the limit
is increased again.

doc/configuration.txt
src/dumpstats.c

index a270d69487e668d7034369a3137e097724cbf53a..3788ac025ac27dce0c1789f8db74dc1b1ff28ae7 100644 (file)
@@ -10464,11 +10464,11 @@ quit
   Close the connection when in interactive mode.
 
 set maxconn frontend <frontend> <value>
-  Dynamically change the specified frontend's maxconn setting. Any non-null
-  positive value is allowed, but setting values larger than the global maxconn
-  does not make much sense. If the limit is increased and connections were
-  pending, they will immediately be accepted. If it is lowered to a value below
-  the current number of connections, new connections acceptation will be
+  Dynamically change the specified frontend's maxconn setting. Any positive
+  value is allowed including zero, but setting values larger than the global
+  maxconn does not make much sense. If the limit is increased and connections
+  were pending, they will immediately be accepted. If it is lowered to a value
+  below the current number of connections, new connections acceptation will be
   delayed until the threshold is reached. The frontend might be specified by
   either its name or its numeric ID prefixed with a sharp ('#').
 
index 7c01e79bc08627c694a6b7d4df0d878c27d70aa6..c8b60a61bb712110695fa371f6c8cdd165442574 100644 (file)
@@ -1113,8 +1113,7 @@ static int stats_sock_parse_request(struct stream_interface *si, char *line)
                                }
 
                                v = atoi(args[4]);
-                               /* check for unlimited values, we restore default setting (cfg_maxpconn) */
-                               if (v < 1) {
+                               if (v < 0) {
                                        si->applet.ctx.cli.msg = "Value out of range.\n";
                                        si->applet.st0 = STAT_CLI_PRINT;
                                        return 1;