mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-07 14:01:54 +00:00
CLEANUP: Use server_parse_maxconn_change_request for maxconn CLI updates
This commit is contained in:
parent
174dd37d88
commit
5c3ed34529
@ -1827,34 +1827,18 @@ static int stats_sock_parse_request(struct stream_interface *si, char *line)
|
||||
}
|
||||
else if (strcmp(args[2], "server") == 0) {
|
||||
struct server *sv;
|
||||
int v;
|
||||
const char *warning;
|
||||
|
||||
sv = expect_server_admin(s, si, args[3]);
|
||||
if (!sv)
|
||||
return 1;
|
||||
|
||||
if (!*args[4]) {
|
||||
appctx->ctx.cli.msg = "Integer value expected.\n";
|
||||
warning = server_parse_maxconn_change_request(sv, args[4]);
|
||||
if (warning) {
|
||||
appctx->ctx.cli.msg = warning;
|
||||
appctx->st0 = STAT_CLI_PRINT;
|
||||
return 1;
|
||||
}
|
||||
|
||||
v = atoi(args[4]);
|
||||
if (v < 0) {
|
||||
appctx->ctx.cli.msg = "Value out of range.\n";
|
||||
appctx->st0 = STAT_CLI_PRINT;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (sv->maxconn == sv->minconn) { // static maxconn
|
||||
sv->maxconn = sv->minconn = v;
|
||||
} else { // dynamic maxconn
|
||||
sv->maxconn = v;
|
||||
}
|
||||
|
||||
if (may_dequeue_tasks(sv, sv->proxy))
|
||||
process_srv_queue(sv);
|
||||
|
||||
return 1;
|
||||
}
|
||||
else if (strcmp(args[2], "global") == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user