src/dumpstats.c
static struct server *expect_server_admin(struct session *s, struct stream_interface *si, char *arg)
{
	struct proxy *px;
	struct server *sv;
	char *line;

	if (s->listener->bind_conf->level < ACCESS_LVL_ADMIN) {
		si->applet.ctx.cli.msg = stats_permission_denied_msg;
		si->applet.st0 = STAT_CLI_PRINT;
		return NULL;
	}

	/* split "backend/server" and make <line> point to server */
	for (line = arg; *line; line++)
		if (*line == '/') {
			*line++ = '\0';
			break;
		}

	if (!*line || !*arg) {
		si->applet.ctx.cli.msg = "Require 'backend/server'.\n";
		si->applet.st0 = STAT_CLI_PRINT;
		return NULL;
	}

	if (!get_backend_server(arg, line, &px, &sv)) {
		si->applet.ctx.cli.msg = px ? "No such server.\n" : "No such backend.\n";
		si->applet.st0 = STAT_CLI_PRINT;
		return NULL;
	}

	if (px->state == PR_STSTOPPED) {
		si->applet.ctx.cli.msg = "Proxy is disabled.\n";
		si->applet.st0 = STAT_CLI_PRINT;
		return NULL;
	}

	return sv;
}
/* Expects to find a backend and a server in <arg> under the form <backend>/<server>,
 * and returns the pointer to the server. Otherwise, display adequate error messages
 * and returns NULL. This function also expects the session level to be admin. Note:
 * the <arg> is modified to remove the '/'.
 */
Expects to find a backend and a server in  under the form /,
and returns the pointer to the server. Otherwise, display adequate error messages
and returns NULL. This function also expects the session level to be admin. Note:
the  is modified to remove the '/'.
Expects to find a backend and a server in under the form / and returns the pointer to the server . Otherwise display adequate error messages and returns NULL . This function also expects the session level to be admin . Note : the is modified to remove the ' / ' .
static struct server *expect_server_admin(struct session *s, struct stream_interface *si, char *arg)
{
	struct proxy *px;
	struct server *sv;
	char *line;
	if (s->listener->bind_conf->level < ACCESS_LVL_ADMIN) {
		si->applet.ctx.cli.msg = stats_permission_denied_msg;
		si->applet.st0 = STAT_CLI_PRINT;
		return NULL;
	}
	for (line = arg; *line; line++)
		if (*line == '/') {
			*line++ = '\0';
			break;
		}
	if (!*line || !*arg) {
		si->applet.ctx.cli.msg = "Require 'backend/server'.\n";
		si->applet.st0 = STAT_CLI_PRINT;
		return NULL;
	}
	if (!get_backend_server(arg, line, &px, &sv)) {
		si->applet.ctx.cli.msg = px ? "No such server.\n" : "No such backend.\n";
		si->applet.st0 = STAT_CLI_PRINT;
		return NULL;
	}
	if (px->state == PR_STSTOPPED) {
		si->applet.ctx.cli.msg = "Proxy is disabled.\n";
		si->applet.st0 = STAT_CLI_PRINT;
		return NULL;
	}
	return sv;
}
static struct server * expect_server_admin ( struct session * s , struct stream_interface * si , char * arg ) { struct proxy * px ; struct server * sv ; char * line ; if ( s -> listener -> bind_conf -> level < ACCESS_LVL_ADMIN ) { si -> applet . ctx . cli . msg = stats_permission_denied_msg ; si -> applet . st0 = STAT_CLI_PRINT ; return NULL ; } for ( line = arg ; * line ; line ++ ) if ( * line == ' ' ) { * line ++ = ' \0 ' ; break ; } if ( ! * line || ! * arg ) { si -> applet . ctx . cli . msg = " \n " ; si -> applet . st0 = STAT_CLI_PRINT ; return NULL ; } if ( ! get_backend_server ( arg , line , & px , & sv ) ) { si -> applet . ctx . cli . msg = px ? " \n " : " \n " ; si -> applet . st0 = STAT_CLI_PRINT ; return NULL ; } if ( px -> state == PR_STSTOPPED ) { si -> applet . ctx . cli . msg = " \n " ; si -> applet . st0 = STAT_CLI_PRINT ; return NULL ; } return sv ; }
Expects to find a backend and a server in <arg> under the form <backend>/<server>,
 and returns the pointer to the server.
Expects to find a backend and a server in <arg > under the form <backend > / <server > and returns the pointer to the server .
/* split "backend/server" and make <line> point to server */