may be specified either by their name or by their numeric ID, prefixed with a
dash ('#').
+set timeout cli <delay>
+ Change the CLI interface timeout for current connection. This can be useful
+ during long debugging sessions where the user needs to constantly inspect
+ some indicators without being disconnected. The delay is passed in seconds.
+
set weight <backend>/<server> <weight>[%]
Change a server's weight to the value passed in argument. If the value ends
with the '%' sign, then the new weight will be relative to the initially
" show sess : report the list of current sessions\n"
" get weight : report a server's current weight\n"
" set weight : change a server's weight\n"
+ " set timeout : change a timeout setting\n"
"";
const char stats_permission_denied_msg[] =
return 1;
}
- else { /* not "set weight" */
+ else if (strcmp(args[1], "timeout") == 0) {
+ if (strcmp(args[2], "cli") == 0) {
+ unsigned timeout;
+ const char *res;
+
+ if (!*args[3]) {
+ s->data_ctx.cli.msg = "Expects an integer value.\n";
+ si->st0 = STAT_CLI_PRINT;
+ return 1;
+ }
+
+ res = parse_time_err(args[3], &timeout, TIME_UNIT_S);
+ if (res || timeout < 1) {
+ s->data_ctx.cli.msg = "Invalid timeout value.\n";
+ si->st0 = STAT_CLI_PRINT;
+ return 1;
+ }
+
+ s->req->rto = s->rep->wto = 1 + MS_TO_TICKS(timeout*1000);
+ return 1;
+ }
+ else {
+ s->data_ctx.cli.msg = "'set timeout' only supports 'cli'.\n";
+ si->st0 = STAT_CLI_PRINT;
+ return 1;
+ }
+ }
+ else { /* unknown "set" parameter */
return 0;
}
}