[4.0] b9255f9 Update description
Lasse Karstensen
lkarsten at varnish-software.com
Thu Jan 15 16:35:41 CET 2015
commit b9255f9701ab0523338ed2f675f306139d460d33
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date: Tue Nov 11 23:13:36 2014 +0000
Update description
Minor cosmetic changes while here. Discussed with Dag on Frankfurt.
diff --git a/bin/varnishd/cache/cache_backend_cfg.c b/bin/varnishd/cache/cache_backend_cfg.c
index 5cf077e..f83e05d 100644
--- a/bin/varnishd/cache/cache_backend_cfg.c
+++ b/bin/varnishd/cache/cache_backend_cfg.c
@@ -287,8 +287,8 @@ backend_find(struct cli *cli, const char *matcher, bf_func *func, void *priv)
ssize_t ip_l = 0;
const char *port_b = NULL;
ssize_t port_l = 0;
- int found = 0;
- int i, j;
+ int all, found = 0;
+ int i;
name_b = matcher;
if (matcher != NULL) {
@@ -343,8 +343,8 @@ backend_find(struct cli *cli, const char *matcher, bf_func *func, void *priv)
}
}
- for (j = 0; j < 2; ++j) {
- if (j == 0 && name_b == NULL)
+ for (all = 0; all < 2 && found == 0; all++) {
+ if (all == 0 && name_b == NULL)
continue;
VTAILQ_FOREACH(b, &backends, list) {
CHECK_OBJ_NOTNULL(b, BACKEND_MAGIC);
@@ -354,7 +354,7 @@ backend_find(struct cli *cli, const char *matcher, bf_func *func, void *priv)
if (name_b != NULL &&
strncmp(b->vcl_name, name_b, name_l) != 0)
continue;
- if (j == 0 && b->vcl_name[name_l] != '\0')
+ if (all == 0 && b->vcl_name[name_l] != '\0')
continue;
if (ip_b != NULL &&
(b->ipv4_addr == NULL ||
@@ -365,9 +365,7 @@ backend_find(struct cli *cli, const char *matcher, bf_func *func, void *priv)
found++;
i = func(cli, b, priv);
if (i)
- return(i);
- if (j == 0)
- return (1);
+ return (i);
}
}
return (found);
@@ -472,11 +470,12 @@ cli_backend_set_health(struct cli *cli, const char * const *av, void *priv)
/*---------------------------------------------------------------------*/
static struct cli_proto backend_cmds[] = {
- { "backend.list", "backend.list",
- "\tList all backends\n",
+ { "backend.list", "backend.list [<backend_expression>]",
+ "\tList backends.",
0, 1, "", cli_backend_list },
- { "backend.set_health", "backend.set_health matcher state",
- "\tSet health status on a backend\n",
+ { "backend.set_health",
+ "backend.set_health <backend_expression> <state>",
+ "\tSet health status on the backends.",
2, 2, "", cli_backend_set_health },
{ NULL }
};
More information about the varnish-commit
mailing list