MINOR: cli: allow to set frontend maxconn to zero

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.
This commit is contained in:
Willy Tarreau 2012-09-26 21:07:15 +02:00
parent a7944ad9ef
commit 3c7a79dbb1
2 changed files with 6 additions and 7 deletions

View 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 ('#').

View 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;