MINOR: cli: don't add a semicolon at the end of HAPROXY_CLI

Only add the semicolon when there is several CLI in HAPROXY_CLI and
HAPROXY_MASTER_CLI.
This commit is contained in:
William Lallemand 2019-04-12 16:09:25 +02:00 committed by Willy Tarreau
parent 9a37fd0f19
commit 620072bc0d

View File

@ -391,6 +391,10 @@ int listeners_setenv(struct proxy *frontend, const char *varname)
char addr[46];
char port[6];
/* separate listener by semicolons */
if (trash->data)
chunk_appendf(trash, ";");
if (l->addr.ss_family == AF_UNIX) {
const struct sockaddr_un *un;
@ -411,8 +415,6 @@ int listeners_setenv(struct proxy *frontend, const char *varname)
} else if (l->addr.ss_family == AF_CUST_SOCKPAIR) {
chunk_appendf(trash, "sockpair@%d", ((struct sockaddr_in *)&l->addr)->sin_addr.s_addr);
}
/* separate listener by semicolons */
trash->area[trash->data++] = ';';
}
}
trash->area[trash->data++] = '\0';